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
# rbenv shell helper patch | |
module Babushka | |
module ShellHelpers | |
# Run +cmd+ via #shell, raising an exception if it doesn't exit | |
# with success. | |
def shell! *cmd, &block | |
opts = cmd.extract_options! | |
cmd = cmd.first if cmd.map(&:class) == [Array] |
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/sh -x | |
# no python3 (pip3) or curl? use this | |
# brew install python3 curl | |
# https://github.com/flyingrub/scdl | |
# pip3 install scdl | |
curl -s http://poolsideapi2.herokuapp.com/tracks?p=2 | grep -o '"scUrl": ".*",$' | sed -E 's/("scUrl": "|",.*$)//g' | xargs -I 'url' scdl -l url --hidewarnings |
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
# brew install sox | |
echo '(play -q -n synth sine F2 sine C3 remix - fade 0 4 .1 norm -4 bend 0.5,2399,2 fade 0 4.0 0.5 &)' >> ~/.bash_profile | |
# via https://twitter.com/climagic/status/467322823631831040 |
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 | |
class Card | |
attr_accessor :rank, :suit | |
def initialize(rank, suit) | |
self.rank = rank | |
self.suit = suit | |
end |
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
# install gems with; | |
# gem install io-console github_api --no-ri --no-rdoc | |
require 'github_api' | |
require 'io/console' | |
# Bypass annoying deprecation warning between the | |
# github_api gem and the faraday gem | |
Faraday::Builder = Faraday::RackBuilder |
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
119006,15849,364397,"","" | |
287931,25665,1615619,"","" | |
249087,36798,1421176,"","" | |
131271,48647,1489200,"","" | |
207525,53651,1489200,"","" | |
207556,53812,1489200,"","" | |
207424,54991,1489200,"","" | |
243232,55069,1489200,"","" | |
182615,56985,1489200,"","" | |
92903,0,20326,"","" |
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 | |
filecontent=( `cat "repo_list" `) | |
for repo in "${filecontent[@]}" | |
do | |
echo $repo " - cloning ..." | |
git clone -q [email protected]:$repo | |
done |
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 HomeSerializer < ApplicationSerializer | |
def _links | |
{ | |
order_volume_forecasts: { href: order_volume_forecasts_url } | |
slots: { href: slots_url }, | |
micro_contracts: { href: micro_contracts_url } | |
} | |
end | |
end |
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 | |
class LinkedListNode | |
attr_accessor :value, :next_node | |
def initialize(value, next_node = nil) | |
@value = value | |
@next_node = next_node | |
end | |
end |
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 | |
# TDLR; run rails migration commands via aliases with auto-completion for version numbers (via fzf) | |
# | |
# brew install fzf | |
# curl https://gist.githubusercontent.com/matthutchinson/6c1bc7681b323d4d2ef5d5a55626a5cf/raw/fzf_migrations > ~/.fzf_migrations | |
# source ~/.fzf_migrations | |
# | |
# Then run these commands to migrate: | |
# |