Skip to content

Instantly share code, notes, and snippets.

View timsavery's full-sized avatar

Tim Savery timsavery

View GitHub Profile
@timsavery
timsavery / Ruby Download Parse JSON
Created January 22, 2012 15:19
Example For Downloading and Parsing JSON (Ruby)
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@timsavery
timsavery / auth-get-projects-teamcity.rb
Created February 24, 2012 15:04
Authenticate & Get Projects from TeamCity API (Ruby)
require 'rubygems'
require 'rest-client'
require 'xmlsimple'
host = ''
login = ''
password = ''
authresponse = RestClient.post 'http://' + host + '/rest/user/login', :login => login, :password => password
cookies = authresponse.cookies
@timsavery
timsavery / jitsu fail
Created February 28, 2012 23:19
jitsu fail
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn:
warn: Your package.json file is missing required fields:
warn:
warn: engines
warn:
warn: Prompting user for required fields.
warn: Press ^C at any time to quit.
<img src="/images/speakers/paolo-fragomeni.jpg" alt="Headshot of Paolo Fragomeni" align="left" />
<section>
<h1>Paolo Fragomeni&nbsp;&nbsp;|&nbsp;&nbsp;Co-founder and CTO, Nodejitsu<br><a href="http://nodejitsu.com/" target="_blank">Nodejitsu.com »</a></h1>
<p>Full stack developer, co-founder and CTO of @Nodejitsu, Open Source/Open Web advocate.</p>
</section>
<div class="clear"></div>
</li>
<li class="speakers">
<img src="/images/speakers/daniel-shaw.jpg" alt="Headshot of Daniel D. Shaw" align="left" />
<section>
@timsavery
timsavery / gist:2284697
Created April 2, 2012 16:10
jitsu deploy error
tsavery@tangialt01:~/Aptana Studio 3 Workspace/node.ph$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/tsavery/Aptana Studio 3 Workspace/node.ph/package.json
data:
data: {
@timsavery
timsavery / StatsThoughts
Created April 5, 2012 20:07
Stats Thoughts
1) Cache Hits/Misses: http://www.shopify.com/technology/3709232-statsd-at-shopify
2) Product/Index Valuation Times:
- key: Platform.{hostname}.Valuation.{product}.{index}.TimeToCompletion
- value: # ms for valuation to complete
var amqp = require('amqp');
var connection = amqp.createConnection();
connection.on('ready', function() {
connection.exchange('ServiceCalls', { type: 'fanout' }, function(exchange) {
connection.queue('AllServiceCalls', function(queue) {
queue.bind(exchange, '#');
queue.subscribe(function(message, headers, deliveryInfo) {
tsavery@tangialt01:~/github/timsavery/gklst-cards-scroll$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/tsavery/github/timsavery/gklst-cards-scroll/package.json
data:
data: {
tsavery@tangialt01:~/github/timsavery/gklst-cards-scroll$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/tsavery/github/timsavery/gklst-cards-scroll/package.json
data:
data: {
tsavery@tangialt01:~/github/timsavery/nodephilly-raffle$ jitsu env set USER_KEY 833786748121301405160
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command env set USER_KEY 833786748121301400000
info: Nodejitsu ok
tsavery@tangialt01:~/github/timsavery/nodephilly-raffle$ jitsu env set USER_KEY "833786748121301405160"
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command env set USER_KEY 833786748121301400000
info: Nodejitsu ok