Skip to content

Instantly share code, notes, and snippets.

@janwillemtulp
janwillemtulp / simple-password-protection.svelte
Created May 20, 2020 12:45
Svelte simple static page password protection
<script>
let password = ''
const hash = s =>
s.split('').reduce((a, b) => {
a = (a << 5) - a + b.charCodeAt(0)
return a & a
}, 0)
$: console.log(password, hash(password))

Music for working, programming, reading, …

…sleeping, meditating, yoga, after hour…. Mostly ambient, drone, (neo-)classical, dub, minimal techno, deep house, micro house, downtempo, slo-mo house, ketapop, schneckno, jetlagdisco, post-rock, lowfi hip hop…

Please feel free to comment your recommendations.

@brendandawes
brendandawes / Terminal:git:exportbranches
Last active December 6, 2017 11:41
Export branches. Replace <outputDirectory> with the path to where you want to export the branches.
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads);
do git archive --format zip --output <outputDirectory>/${branch}.zip $branch;
done