Skip to content

Instantly share code, notes, and snippets.

@LorenzoBloedow
LorenzoBloedow / fixRelativeImports.cjs
Last active June 17, 2023 17:34
Node.js Script to Fix Relative Imports of a File
const fs = require("fs");
const path = require("path");
const chalk = require("chalk");
/**
ARGUMENTS:
(-P | --paths): Comma-separated list of base paths. All files under these paths will be fixed.
(-I | --import-paths): Comma-separated list of import paths. All files under these paths will be used when searching for imports.
If not provided, the paths from (-P | --paths) will be used.
(-D | --dry-run): Prints the results but doesn't actually write them to the files.
@skokenes
skokenes / index.js
Created September 26, 2019 14:25
SVG Path Generator for Rounded Rectangles
function createRoundedRectPath(x, y, width, height, radius) {
return (
// Move to position, offset by radius in x direction
"M" +(x + radius) + "," + y
// Draw a horizontal line to the top right curve start
+ "h" + (width - 2 * radius)
// Draw the top right corner curve
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius
// Draw a vertical line to the bottom right corner
+ "v" + (height - 2 * radius)
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>