The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
#!/usr/bin/env node | |
/* global process */ | |
var fs = require('fs'); | |
if (process.argv.length < 4) { | |
console.error( | |
'Usage: node make-index.js <comma-separated desired file exts, e.g. mp4,gif> <directory with files>' | |
); | |
process.exit(1); |
// Paste this into the console and get ready to click "Save" in response to the save dialog a bunch of times. Or better yet, disable asking where to save in your browser. | |
var buttons = document.querySelectorAll('.sc-button-more') | |
var index = 0; | |
function moreNext() { var more = buttons[index]; more.click(); ++index; setTimeout(dl, 500); } | |
function dl() { var dlButton = document.querySelector('.sc-button-download'); dlButton.click(); if (index < buttons.length) { setTimeout(moreNext, 100);}} | |
moreNext(); |
#!/usr/bin/env node | |
/* global process */ | |
var fs = require('fs'); | |
var imgFileExts = ['png', 'jpg']; | |
if (process.argv.length < 3) { | |
console.error( | |
'Usage: node make-index.js <directory with images>' |
[Desktop Entry] | |
Name=Obsidian | |
GenericName=Notes organizer | |
Comment=Organize notes | |
Exec=/home/jimkang/apps/Obsidian-1.0.3.AppImage | |
Terminal=false | |
Type=Application | |
Keywords=notes;organizer; | |
Keywords[fr]=Texte;éditeur; | |
Keywords[ru]=текст;текстовый редактор; |
function getYourClass(targetClass) { document.getElementById('roll-button').click(); setTimeout(() => { if (document.getElementById('class').textContent !== targetClass) { window.requestAnimationFrame(() => getYourClass(targetClass)); }}, 0) } | |
getYourClass('Ranger') | |
// Edit selector to check things other than strength. | |
function getYourScore(minScore) { document.getElementById('roll-button').click(); setTimeout(() => { if (+document.querySelector('.row:first-child .ability-score-column').textContent < minScore) { window.requestAnimationFrame(() => getYourScore(minScore)); }}, 0) } | |
getYourScore(16) |
#!/bin/bash | |
for file in *.zip | |
do | |
filename="${file%.*}" | |
# Filenames can't contain /. So, I wonder | |
# what Bandcamp would do if they had AC/DC? | |
unzippath=$(echo "$filename" |sed -e 's/ - /\//') | |
mkdir -p "$unzippath" | |
unzip "$filename" -d "$unzippath" |
#!/bin/bash | |
src=. | |
start=$1 | |
end=$2 | |
if [[ ! $start ]] && [[ ! $end ]]; then | |
printf "Usage: ./tools/get-entries-in-date-range.sh [start string] [end string]\nEnd string is optional.\n\nExample: To get filenames that come after 2020-03 (anywhere in March) but before 2020-03-29 (assuming files follow this naming convention):\n./tools/get-entries-in-date-range.sh 2020-03 2020-03-29\n"; | |
exit 1; | |
fi |
import pickle | |
import json | |
data = pickle.load(open('file.pkl', 'rb')) | |
out_file = open("out.json", "w") | |
out_file.write(json.dumps(data)) |
var { easeCubic } = require('d3-ease') | |
var { range } = require('d3-array') | |
range(0, 1, 0.05).map(easeCubic).map(n => n.toFixed(2)).join(';') |