Skip to content

Instantly share code, notes, and snippets.

@jnoh
jnoh / bitly.rb
Created March 12, 2014 08:09 — forked from jehiah/bitly.rb
# Bit.ly API implementation - thanks to Richard Johansso http://gist.github.com/112191
require 'httparty'
class Api::Bitly
include HTTParty
base_uri 'api.bit.ly'
format :json
# Usage: Bitly.shorten("http://example.com")
def self.shorten(url)
@jnoh
jnoh / xtea.rb
Created September 3, 2013 22:21 — forked from cabron/xtea.rb
class XTEA
attr_reader :key, :key_o
MASK = 0xFFFFFFFF
DELTA = 0x9E3779B9
def initialize(key=rand(2**128), n=32)
@key_o = key
@n = n