View Crypto.gs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
console.log(cryptoPrice("blockstack", "0.1")); | |
} | |
/** | |
* Sets a random number in P1 | |
* @customfunction | |
*/ | |
function refresh() { |
View Code.gs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _tester() { | |
Logger.log("New test run…") | |
var result = gc_distance('sfo', 'jfk'); | |
Logger.log(result) | |
} | |
function location_of(airport) { | |
return data[airport.toUpperCase()]; | |
} |
View spotify-star-adder.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rspotify' | |
require 'open3' | |
require 'uri' | |
require 'json' | |
# To use script | |
# 1/ Create an app at: https://developer.spotify.com/dashboard/applications |
View shortest-string-path-substitutions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Words = Set.new | |
File.open('/usr/share/dict/words') do |file| | |
file.each do |line| | |
Words.add(line.strip) | |
end | |
end | |
Alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('') | |
def path(input, output) |
View .pryrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
alias :old_methods :methods | |
def methods | |
old_methods.reject do |m| | |
m = m.to_s | |
m =~ /(=|_changed\?|_before_type_cast|_was|_change|_will_change!)$/ || \ | |
m =~ /^_/ | |
end | |
end | |
end |
View glossarize.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var glossary = { | |
"744":" 747-400", | |
"(S)RB":"(Sir) Richard Branson", | |
"*A":"the acronym stands for the Star Alliance.", | |
"*G":"Star Alliance Gold - Star Alliance status extended to 1Ps and 1Ks (BD*G Diamond Club Gold)", | |
"*S":"Star Alliance Silver - Star Alliance status extended to 2Ps and 3Ps (BD*S Diamond Club Silver)", | |
"-lite":"A member that obtains a status level through promotions", | |
"1K":"United Mileage Plus Premier Executive 1K status. Awarded to members who fly 100,000 actual miles or 100 paid segments.", | |
"1P":"Premier Executive - 50,000 miles or 60 segments in a calendar year", | |
"2K, 3K, etc.":"A less formal term to indicate those that have received 200,000 or 300,000 EQM in a year or 200 or 300 EQS in a year.", |
View present.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set colorcolumn=0 | |
set nocursorline | |
set noshowmode | |
set noshowcmd | |
set noruler | |
set laststatus=0 | |
set noswapfile | |
set nomodifiable | |
highlight clear OverLength | |
highlight clear ExtraWhitespace |
View commit-docker-data-container.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script does not work on OS X | |
[[ "$(uname -s)" == Darwin ]] && echo "This script cannot run under OS X" && exit 1 | |
container_name=treasury_dbdata_1 | |
container_id="$(docker inspect treasury_dbdata_1 | jq -r '.[0].Id')" | |
volume_path=/var/lib/mysql | |
tag=data |
View elevatorsaga.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
init: function(elevators, floors) { | |
var idleElevators = []; | |
var upsRequested = []; | |
var downsRequested = []; | |
var goAndSetIndicator = function (elevator, num, index) { | |
console.log('k: figure out where to go next'); |
View progress.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PID=$(ps aux | grep mysql-dev-backup-s3 | grep -v grep | awk '{ print $2 }') | |
# for some stupid reason, stat in our vagrant vms takes `-c format` not `-f`... | |
ontrap () { | |
echo | |
exit 0 | |
} |
NewerOlder