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
# 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}"}, |
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
<!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. | |
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
class Die | |
def initialize | |
roll | |
end | |
def roll | |
@numberShowing = 1 + rand(6) | |
end |
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
###### 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 |
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
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 |
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
# keyword plugin | |
# ==== | |
# | |
# config example: | |
# | |
# Earthquake.config[:keyword] = {:pattern => /ruby|rails|earthquake/i} | |
# | |
Earthquake.init do | |
_ = config[:keyword] ||= {} | |
_[:notify] = true if _[:notify].nil? |
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
// ==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/* |
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
// ==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/* |
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
▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀ | |
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 |
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
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 |
OlderNewer