(adapted from https://github.com/StashInvest/rfcs/blob/master/template.md)
- Team or individual: [name(s) here]
- Document date: [ISO 8601 YYYY-MM-DD format]
const fun = ` | |
(async () => { | |
const sleep = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout)); | |
const btns = [...document.getElementsByClassName("btn")].filter( it => it.title === "Add to Card"); | |
for (let i = 0; i < btns.length; i++) { | |
btns[i].click(); | |
await sleep(1000); | |
} | |
})() | |
`; |
(adapted from https://github.com/StashInvest/rfcs/blob/master/template.md)
#!/usr/bin/env node | |
const { execSync } = require("child_process") | |
const readline = require("readline"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const read = (question) => { | |
return new Promise(resolve => { |
/** Adapted from https://codepen.io/pimskie/pen/jEVPNx **/ | |
function Flake(x, y, maxSpeedConfig) { | |
const maxWeight = 5; | |
const maxSpeed = maxSpeedConfig || 3; | |
this.x = x; | |
this.y = y; | |
this.r = randomBetween(0, 1); | |
this.a = randomBetween(0, Math.PI); | |
this.aStep = 0.01; |
#!/bin/bash | |
# Clears finished downloads from Transmission. | |
# Version: 1.1 | |
# | |
# Newest version can always be found at: | |
# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a | |
# | |
# Server string is resolved in this order: | |
# 1. TRANSMISSION_SERVER environment variable |
// 1. Open https://robinhood.com/account/history | |
// 2. paste code into console | |
var parse = () => { | |
let csv = "Name,Action,Amount\n"; | |
let sections = document.querySelectorAll("[class*=rh-expandable-item]") | |
let credit = 0; | |
let debit = 0; | |
let validActions = ["Buy", "Sell", "Expiration"] |
const Gpio = require('onoff').Gpio; | |
const exec = require('child_process').exec; | |
let started = false; | |
const config = { | |
sensorPin: 14, | |
sensorState: 1, | |
relayPin: false, | |
relayState: 1, | |
alwaysOnPin: false, |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="TheChinaClub" | |
psk="testingPassword" | |
} |
const request = require("request-promise"); | |
const cheerio = require("cheerio"); | |
const NUMBER_REGEX = "\\-?\\+?[0-9]{1,3}(,[0-9]{3})*(.[0-9]+)?"; | |
const stockPriceRegex = () => | |
new RegExp( | |
`Stock Price(?<price>${NUMBER_REGEX})\\s(?<day_change>${NUMBER_REGEX})\\s(?<day_percent>\\(?\\d+.\\d+%)`, | |
"gm" | |
); | |
const afterHoursStockPriceRegex = () => | |
new RegExp( |
ln -s "/Users/`whoami`/Google Drive/alfred/snippets" "/Users/`whoami`/Library/Application Support/Alfred/Alfred.alfredpreferences/snippets" | |
ln -s "/Users/`whoami`/Google Drive/alfred/themes" "/Users/`whoami`/Library/Application Support/Alfred/Alfred.alfredpreferences/themes" |