First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.
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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName example.com | |
# ServerAlias *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain |
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
gemcutter => redis downloads spec | |
================================= | |
keys | |
---- | |
downloads => global counter for all gem downloads | |
downloads:today => sorted set for downloads from today | |
downloads:rubygem:rails => counter for all rails downloads | |
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads |
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
# ------------------------------------------------------------------ | |
# Desigining "trending topics in 24 hours sliding window" with Redis | |
# ------------------------------------------------------------------ | |
redis-cli del tophashes:2010-12-07-08-00 | |
redis-cli del tophashes:2010-12-07-09-00 | |
redis-cli del tophashes:current | |
echo '=== 8:00 AM ===' |
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
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The | |
# XML Reader is a good way to move a cursor through a (large) XML document fast, | |
# but is not as cumbersome as writing a full SAX document handler. Read about | |
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html | |
# | |
# Just pass the reader in this parser and specificy the nodes that you are interested | |
# in in a block. You can just parse every node or only look inside certain nodes. | |
# | |
# A small example: | |
# |
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
# =============================== | |
# Counters with Redis Sorted Sets | |
# =============================== | |
redis-cli DEL downloads:total downloads:total:today downloads:files:total downloads:files:2011-05-10 | |
# -------------- | |
# STORING COUNTS | |
# -------------- | |
# On each hit for file, do this: |
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
haiku = -> | |
adjs = [ | |
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", | |
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter", | |
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue", | |
"billowing", "broken", "cold", "damp", "falling", "frosty", "green", | |
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old", | |
"red", "rough", "still", "small", "sparkling", "throbbing", "shy", | |
"wandering", "withered", "wild", "black", "young", "holy", "solitary", | |
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine", |
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
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
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
/** Reinflates a compressed signature string: | |
resolution = a representation of the resolution in | |
pixels of the canvas which this signature will be drawn | |
e.g. {x:800,y:200} | |
*/ | |
var inflateToJsonSignature = function (deflatedSig, resolution) { | |
var components = [], | |
modifier = 1, | |
compressWithResolution = /^(?:\[(\d+)x(\d+)\])?([\w\W]*)/, | |
parsedSigString = deflatedSig.match(compressWithResolution), |
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 OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
OlderNewer