Skip to content

Instantly share code, notes, and snippets.

View JustinAiken's full-sized avatar
💎
Rubyin'

Justin Aiken JustinAiken

💎
Rubyin'
View GitHub Profile
@JustinAiken
JustinAiken / facebook_scrape.rb
Created December 4, 2012 22:49
facebook election scraper
require 'koala'
AUTH_TOKEN = ENV["AUTH_TOKEN"]
START_TIME = Date.new(2012,11,5).to_time.to_i
END_TIME = Date.new(2012,11,8).to_time.to_i
@facebook = Koala::Facebook::API.new(AUTH_TOKEN)
friends = @facebook.get_connections("me", "friends").sort_by {|friend| friend["name"]}
friends = friends[161..(friends.count - 1)]
@JustinAiken
JustinAiken / rbenv-howto.md
Created October 29, 2012 22:07 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Not sure how much of this we need

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@JustinAiken
JustinAiken / ahn_api.rb
Created October 21, 2012 22:16
SinAhnTra
require 'sinatra'
require 'json'
require 'ahn_api_helpers'
class AhnApi < Sinatra::Base
set :port, 8080
set :environment, ENV['AHN_ENV']
helpers Helpers
@JustinAiken
JustinAiken / create_geo.rb
Created October 9, 2012 19:46
Logmycalls API methods for routes
get "http://dev.api.logmycalls.com/services/createRoute",
{
api_key: API_KEY,
api_secret: API_SECRET,
criteria:
{
tracking_number: 8013334646,
message: "blank",
default_ringto: 4358675309,
ouid: 1,
@JustinAiken
JustinAiken / api_class.php
Created August 7, 2012 21:34 — forked from libryder/api_class.php
LogMyCalls API PHP Sample
<?php
/* LogMyCalls public API
*
* PHP Sample
* Author: David Ryder
* dryder@contactpoint.com
* http://github.com/libryder
*
* The LmcApi is a JSON wrapper using CURL to send and receive data
def problem001
total = 0
for i in 1..9
if i%3 == 0
puts "#{i} is divisible by 3"
total = total + i
puts total
end
if i%5 == 0
puts "#{i} is divisible by 5"