Skip to content

Instantly share code, notes, and snippets.

@viking
viking / wavepot.js
Created June 19, 2014 22:06
wavepot song
var pitches = {
'C4': 262,
'C#4': 278,
'D4': 294,
'D#4': 311,
'E4': 330,
'F4': 349,
'F#4': 370,
'G4': 392,
'G#4': 415,
@viking
viking / mario-kart.js
Last active August 29, 2015 14:02
Mario Kart wavepot song
var pitches = {
'B2': 123,
'C3': 131,
'C#3': 139,
'D3': 147,
'D#3': 156,
'E3': 165,
'F3': 175,
'F#3': 185,
'G3': 196,
@viking
viking / ffx-lightning.sh
Created October 18, 2014 12:56
Script for sound notifications on when to dodge lightning in Final Fantasy X
#!/bin/bash
quick() {
sleep 1
afplay /System/Library/Sounds/Morse.aiff &
sleep 1
afplay /System/Library/Sounds/Morse.aiff &
sleep 1
afplay /System/Library/Sounds/Ping.aiff &
}
njero - http://neverlet.be
sutto - http://blog.ninjahideout.com
zapnap - http://blog.zerosum.org
tpope - http://tpope.net
reinh - http://reinh.com
bryanl - http://smartic.us
linoj - http://www.vaporbase.com
technicalpickles - http://technicalpickles.com
MaD15 - enlightsolutions.com/
qrush - http://litanyagainstfear.com/
@viking
viking / gist:975493
Created May 16, 2011 22:10
Combo breaker!
[17:07] <viking> the cake is a LIE
[17:07] <wlll> the cake is a PIE
[17:07] <viking> the cake is a PIG
[17:08] <wlll> the cake is a PEG
[17:08] <viking> the cake is a PUG
[17:08] <wlll> the cake is a MUG
[17:08] <context> the cake is a MAG
[17:08] <context> the cake is a VAG
[17:08] <context> :x i had to
[17:09] <wlll> COMBO BREAKER!
target="beef"; i=0; msg=`git log -1 --pretty="%B"`; while true; do hash=`git rev-parse HEAD`; if [[ $hash == "$target"* ]]; then break; fi; git commit --amend -q -m "$msg$i"; i=$((i+1)); echo $i; if [ $((i % 10000)) -eq 9999 ]; then echo "Cleaning up..."; git gc; fi; done
@viking
viking / compo.sh
Created September 30, 2016 20:24
Download and extract tracker files from s3m competitions
#!/bin/bash
num=$1
wget --content-disposition https://s3m.it/pack/$num
file=`ls -t | head -n 1`
dir=`echo "$file" | sed 's/\.7z$//'`
mkdir "$dir"
cd "$dir"
7z x "../$file"
cd -

Keybase proof

I hereby claim:

  • I am viking on github.
  • I am kindlyviking (https://keybase.io/kindlyviking) on keybase.
  • I have a public key whose fingerprint is 2F1C B90A 31C6 0CE5 91DF 9C1B CB5A 9B0C F299 379C

To claim this, I am signing this object:

@viking
viking / diet.sql
Last active May 21, 2019 22:58
Utilities for simple nutrition tracking (SQLite)
/* References:
* https://www.fda.gov/food/nutrition-education-resources-and-materials/how-understand-and-use-nutrition-facts-label
* https://www.accessdata.fda.gov/scripts/interactivenutritionfactslabel/factsheets/vitamin_and_mineral_chart.pdf
*/
CREATE TABLE servings (id INTEGER PRIMARY KEY, product TEXT, size TEXT, grams NUMERIC DEFAULT 0, calories NUMERIC DEFAULT 0, total_fat_g NUMERIC DEFAULT 0, sat_fat_g NUMERIC DEFAULT 0, trans_fat_g NUMERIC DEFAULT 0, cholesterol_mg NUMERIC DEFAULT 0, sodium_mg NUMERIC DEFAULT 0, total_carb_g NUMERIC DEFAULT 0, fiber_g NUMERIC DEFAULT 0, total_sugars_g NUMERIC DEFAULT 0, protein_g NUMERIC DEFAULT 0, vitamin_a_mcg NUMERIC DEFAULT 0, vitamin_c_mcg NUMERIC DEFAULT 0, vitamin_d_mcg NUMERIC DEFAULT 0, calcium_mg NUMERIC DEFAULT 0, iron_mg NUMERIC DEFAULT 0, potassium_mg NUMERIC DEFAULT 0, updated_at DATE);
CREATE TABLE diet (id INTEGER PRIMARY KEY, servings_id INTEGER, num_servings INTEGER DEFAULT 0, time_stamp DATETIME);
CREATE VIEW daily_amount AS SELECT strftime('%Y-%
@viking
viking / coda-feed.rb
Last active October 1, 2020 15:32
Script to download songs by coda
require 'rss'
require 'uri'
url = 'http://coda.s3m.us/feed/'
URI.open(url) do |rss|
feed = RSS::Parser.parse(rss, false)
feed.items.each do |item|
if item.enclosure
url = URI.parse(item.enclosure.url)
filename = File.basename(url.path)