this gist is a combination of these two links:
running scripts on macos startup and get-borderless-arc repo
open automator.app
select "new document"
select "application"
function generateRandomHexCode() { | |
const validChars = "abcdef0123456789"; | |
let hexcode = "#"; | |
for (let i = 0; i < 6; i++) { | |
const char = validChars[Math.floor(Math.random() * validChars.length)]; | |
hexcode += char; | |
} | |
return hexcode; |
<div class="flex justify-between"> | |
<div class="flex flex-1 justify-start">huuuuuuuuuuuuge left element</div> | |
<div class="flex flex-1 justify-center">center element</div> | |
<div class="flex flex-1 justify-end">right element</div> | |
</div> |
import random as rd | |
random = rd | |
tom = ['A','B','C','D','E','F','G'] | |
number_chords = [3,4,5] | |
tom_a = ['A','Bm','C#m','D','E','F#m'] | |
tom_b = ['B','C#m','D#m','E','F#','G#m'] | |
tom_c = ['C','Dm','Em','F','G','Am'] | |
tom_d = ['D','Em','F#m','G','A','Bm'] |
function romanToInteger(roman) { | |
const romanNumerals = { | |
I: 1, | |
V: 5, | |
X: 10, | |
L: 50, | |
C: 100, | |
D: 500, | |
M: 1000, | |
}; |
tailwind octopus | |
what tailwind is | |
a map of css properties | |
classes that have objective names and purposes | |
what tailwind isn’t | |
bootstrap | |
is a component library | |
one class in bootstrap is equivalent to hundreds of opinionated css properties |
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"scope": [ | |
"comment", | |
"comment.block", | |
"comment.block.documentation", | |
"comment.line", | |
"constant", | |
"constant.character", |
function benchmark(testName, callback) { | |
const startTime = performance.now(); | |
callback(); | |
const endTime = performance.now(); | |
console.log(testName, `time: ${endTime - startTime}`); | |
} | |
// usage | |
function addNums(a, b) { |
function benchmark(testName, callback) { | |
const startTime = performance.now(); | |
callback(); | |
const endTime = performance.now(); | |
console.log(testName, `time: ${endTime - startTime}`); | |
} | |
const nums = Array(1000).fill(1); | |
function iterateWithMap(nums) { |
this gist is a combination of these two links:
running scripts on macos startup and get-borderless-arc repo
open automator.app
select "new document"
select "application"
function shuffle(arr) { | |
for (let i = 0; i < arr.length - 1; i++) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[arr[i], arr[j]] = [arr[j], arr[i]]; | |
} | |
return arr; | |
} |