Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile
# This is a code example for the Ruby HTTP library Typhoeus
# here's an example for twitter search
# Including Typhoeus adds http methods like get, put, post, and delete.
# What's more interesting though is the stuff to build up what I call
# remote_methods.
class Twitter
include Typhoeus
remote_defaults :on_success => lambda {|response| JSON.parse(response.body)},
:on_failure => lambda {|response| puts "error code: #{response.code}"},
@jrgifford
jrgifford / fatc.html
Created May 26, 2011 12:46 — forked from tomger/fatc.html
a twitter client in stratified javascript ( http://fatc.onilabs.com )
<!DOCTYPE html>
<html><head>
<title>Fork-A-Twitter-Client</title>
<!--
Basic OniApollo/StratifiedJS Twitter Client application scaffold.
See http://fatc.onilabs.com/
THIS FILE IS IN THE PUBLIC DOMAIN.
class Die
def initialize
roll
end
def roll
@numberShowing = 1 + rand(6)
end
@jrgifford
jrgifford / gist:1600874
Created January 12, 2012 14:37
@jrgifford's Ubuntu 11.10 setup.
###### UBUNTU DEVELOPMENT SETUP ######
### Add Sublime Text 2 ###
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text-2
### Install rvm with railsready ###
wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh
Earthquake.init do
output do |item|
next unless item["_stream"]
if "#{item["user"]["screen_name"]}"!="jrgifford"
notify "#{item["user"]["screen_name"]}: #{item["text"]}"
end
end
end
@jrgifford
jrgifford / keyword.rb
Created January 18, 2012 21:48 — forked from Phize/keyword.rb
keyword plugin for Earthquake(Ruby based Twitter client)
# keyword plugin
# ====
#
# config example:
#
# Earthquake.config[:keyword] = {:pattern => /ruby|rails|earthquake/i}
#
Earthquake.init do
_ = config[:keyword] ||= {}
_[:notify] = true if _[:notify].nil?
@jrgifford
jrgifford / seabandoned.user.js
Created January 25, 2012 18:22 — forked from rlemon/seabandoned.user.js
abandoned user script
// ==UserScript==
// @name LookAtMeImADuplicate
// @author rlemon, jamesgifford
// @version 0.1
// @namespace rlemon.com
// @description Flag SE Questions as Duplicates
// @include http://*stackoverflow.com/*
// @include http://*superuser.com/*
// @include http://*serverfault.com/*
// @include http://*askubuntu.com/*
@jrgifford
jrgifford / seabandoned.user.js
Created February 1, 2012 18:10 — forked from rlemon/seabandoned.user.js
abandoned user script
// ==UserScript==
// @name LookAtMeINeedFlags
// @author rlemon, jamesgifford
// @version 0.2
// @namespace rlemon.com
// @description Flag SE Questions as Duplicates / Abandoned
// @include http://*stackoverflow.com/*
// @include http://*superuser.com/*
// @include http://*serverfault.com/*
// @include http://*askubuntu.com/*
▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀
HANDPICKED JQUERY PLUGINS REPOSITORY CDN URLS
POWERED BY MAXCDN
▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀
http://i.higg.in/jquery/sliders/coin-slider.js
http://i.higg.in/jquery/sliders/jquery.aw-showcase.min.js
h = Hash.new
f = File.open('numbers.csv', "r")
f.each_line { |line|
numbers = line.split
numbers.each { |w|
if h.has_key?(w)
h[w] = h[w] + 1
else
h[w] = 1
end