- [ ]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Colors = "red" | "green" | "blue"; | |
type HSL = [hue: number, saturation: string, lightness: string]; | |
type ColorPalette = Record<Colors, string | HSL> | |
const palette = (): Promise<ColorPalette> => new Promise((resolve, reject) => { | |
resolve({ | |
red: [0, '100%', '50%'], | |
green: "#00ff00", | |
blue: [240, '100%', '50%'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fs = require('fs') | |
let appPath = process.cwd() | |
const execSync = require('child_process').execSync | |
let installedEslintConfig; | |
execSync(`npm uninstall @sr/spl-angular`) | |
execSync(`git add .`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
console.log("I was executed from a gist inside the terminal with npx!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fs = require('fs') | |
let appPath = process.cwd() | |
const execSync = require('child_process').execSync | |
let installedEslintConfig; | |
try { | |
const packageJson = JSON.parse(fs.readFileSync('./package.json')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zx | |
try { | |
const projectsDir = 'code' | |
const projectName = argv.n | |
if (!projectName) { | |
console.error(chalk.red('Please provide argument -n with project name')) | |
process.exit(1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new PerformanceObserver((entryList) => { | |
for (const entry of entryList.getEntries()) { | |
console.log("LCP candidate:", entry.startTime, entry); | |
} | |
}).observe({ type: "largest-contentful-paint", buffered: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function collatz(n) { | |
if (n === 1) { | |
return 0; | |
} | |
if (n % 2 === 0) { | |
return 1 + collatz(n/2); | |
} else { | |
return 1 + collatz(3*n+1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Chrome CRA", | |
"type": "chrome", | |
"request": "launch", | |
"url": "http://localhost:3000", | |
"webRoot": "${workspaceFolder}", | |
"sourceMapPathOverrides": { | |
"webpack:///./*": "${webRoot}/*", | |
"webpack:///src/*": "${webRoot}/*", | |
"webpack:///*": "*", |
NewerOlder