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
require 'json' | |
require 'open-uri' | |
hostname = 'irc' | |
posts = [] | |
page = 1 | |
pages = 1 | |
per_page = 20 | |
begin |
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
require 'open-uri' | |
require 'nokogiri' | |
require 'yaml' | |
def aggressive_strip text | |
text.strip.gsub(/[\s\r\n]+/, ' ') | |
end | |
postal_code = 10003 | |
url = "http://checkout.spirithalloween.com/storelocation.aspx?zipPostalCode=#{ postal_code }" |
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
require 'rubygems' | |
require 'sinatra/base' | |
# ActionPack is a gem that is part of Rails. It includes ActionController and ActionView | |
require 'action_pack' | |
# Rack::Test is not used in this file but ActionController will yell if we don't require it | |
require 'rack/test' | |
# This is part of the ActionPack gem |
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
FOLKS = %w( | |
Caroline | |
Chris | |
Dave | |
Devin | |
Hindi | |
John | |
Kai | |
Nizar | |
Pat |
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
namespace :gem do | |
task publish: [:commit, :build, :fury] | |
task :commit do | |
current_branch = %x(git rev-parse --abbrev-ref HEAD).strip | |
git_status = %x(git status --short --untracked-files=no) | |
unless current_branch == 'master' | |
puts 'Only run this task with master checked out!' | |
return |
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
require 'active_support/all' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'csv' | |
require 'pry' | |
LAST_FM_ENDPOINT = 'http://ws.audioscrobbler.com/2.0/' | |
PAGE_SIZE = 200 | |
def result(username, api_key, page) |
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
/** @jsx React.DOM */ | |
var store = { | |
name: "Chris", | |
position: "there" | |
}; | |
var reduce = function (state, action) { | |
if (action.type === "CHANGE_NAME") { | |
state.name = action.payload; |
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 objectToAttributes = function (object) { | |
var output = ""; | |
var keyTranslations = { | |
className: "class", | |
htmlFor: "for" | |
}; | |
Object.keys(object).forEach(function (key) { | |
var value = object[key]; |
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
require 'json' | |
require 'net/https' | |
require 'uri' | |
def latest_browser_versions | |
uri = URI.parse('https://cdn.rawgit.com/Fyrd/caniuse/master/data.json') | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE |