This file contains hidden or 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
{ | |
"multiquark": { | |
"quarks": [ | |
{ | |
"background_picture": { | |
"id": "5112ac3d94b23b743c00001e" | |
}, | |
"text": "First Page", | |
"title": "stuff" | |
}, |
This file contains hidden or 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
# We had introduced a bug that was causing user registration errors in Rails for certain email addresses. | |
# Fetch the list of unique emails that had failed registration (that produced a particular exception). | |
require 'open-uri' | |
require 'nokogiri' | |
require 'set' | |
AUTH_TOKEN = 'XXX' | |
ERROR_ID = '54425478' |
This file contains hidden or 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
➜ jsonp git:(master) ✗ jitsu deploy | |
info: Welcome to Nodejitsu aidanfeldman | |
info: jitsu v0.10.5, node v0.8.11 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Analyzing application dependencies in server.js | |
debug: { method: 'GET', | |
debug: uri: 'http://api.nodejitsu.com/apps/aidanfeldman/jsonp', | |
debug: headers: | |
debug: { Authorization: 'Basic YWlkYW5mZWxkbWFuOmN1YmJpZTE=', |
This file contains hidden or 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
git clone git://gist.github.com/3944262.git seven_langs_ruby | |
cd seven_langs_ruby | |
gem install gli -v 1.6.0 | |
gem install showoff | |
showoff serve | |
open "http://localhost:9090" |
This file contains hidden or 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
DROP TABLE IF EXISTS profile_matches; | |
DROP TABLE IF EXISTS profiles; | |
-- the "nodes" | |
CREATE TABLE profiles ( | |
id SERIAL PRIMARY KEY, | |
service text, | |
username text | |
); |
This file contains hidden or 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
# run Apple's Software Update | |
# open XCode, then XCode(menu)->Preferences->Downloads tab and Install the Command Line Tools | |
brew update | |
brew doctor | |
# follow any instructions - mine are included below | |
brew tap homebrew/dupes | |
brew install autoconf automake apple-gcc42 | |
brew link apple-gcc42 # for some reason this didn't work in prior step |
This file contains hidden or 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 startTimeInterval = setInterval(function(){ | |
jQuery.getJSON('http://api.corsonus.com/start.json?callback=?', function(data){ | |
var startTime = data.start_time; | |
if (startTime){ | |
clearInterval(startTimeInterval); | |
console.log('counting down...'); | |
var countdownInterval = setInterval(function(){ | |
// number of seconds | |
var remaining = Math.round((startTime - Date.now()) / 1000); | |
console.log('number of seconds remaining: ' + remaining); |
This file contains hidden or 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
# using Mongoid | |
# clean up leading/trailing whitespace | |
User.where(twitter_username: /(\A\s+[A-Za-z0-9_]+\s*\z)|(\A\s*[A-Za-z0-9_]+\s+\z)/).each do |user| | |
user.twitter_username = user.twitter_username.strip | |
user.save! | |
end | |
# clean up twitter usernames of the format @... or twitter.com/... | |
link_rx = /(?:\A@|\A\/|twitter\.com\/(?:#!\/)?)([A-Za-z0-9_]+)\s*\z/i |
This file contains hidden or 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
user = User.find_by_username('catturner') | |
user_id = user.id | |
next_max_id = nil | |
quark_ids = [] | |
picture_ids = [] | |
begin | |
# instagram limits to 60 | |
query = {access_token: user.instagram_token.token, count: 60} | |
query[:max_id] = next_max_id if next_max_id | |
results = HTTParty.get 'https://api.instagram.com/v1/users/self/media/recent', format: :json, query: query |