Skip to content

Instantly share code, notes, and snippets.

View shipstar's full-sized avatar

Kyle Shipley shipstar

  • Fishers, IN
View GitHub Profile
@shipstar
shipstar / gist:7650584
Created November 25, 2013 23:09
Super hacky Turntable --> Plug.dj importer
require 'youtube_it'
PLAYLIST_TITLE = "Turntable to Plug"
auth = {
dev_key: <your key>,
username: <your Youtube username>,
password: <your Youtube password>
}
@shipstar
shipstar / gist:5016267
Last active December 14, 2015 02:49
when_constant
# usage:
# when_constant "Foo::BAR", 'baz' do
# # do something
# end
def when_constant(constant_string, new_value)
class_or_module = nil
constant_name = nil
if constant_string =~ /::/
body{
margin: 0 auto;
font-family: Georgia, Palatino, serif;
color: #444444;
line-height: 1;
max-width: 960px;
padding: 30px;
}
h1, h2, h3, h4 {
color: #111111;
@shipstar
shipstar / test-stub.rb
Created March 5, 2012 21:48 — forked from swanson/test-stub.rb
Toy stub framework with Ruby
# Playing around with a Toy Stubbing "framework"
class Statistics
def initialize(nums)
@nums = nums
end
def compute_average
sum = 0;
@nums.each do |num|
sum += num