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
app = lambda do |env| | |
[301, {'Location' => 'https://www.pensionwise.gov.uk/'}, []] | |
end | |
run app |
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
Date: Tue, 30 Sep 2014 16:49:43 +0000 | |
From: Louis Goff-Beardsley <louis@infinitiumglobal.com> | |
To: London Ruby Users Group <chat@lists.lrug.org> | |
Subject: [LRUG] [JOBS] Contracts Galore | |
Message-ID: <48267692359843abb6ad091ab5441d3d@SEHSTE15D2BE3.hs20.net> | |
Content-Type: text/plain; charset="iso-8859-1" | |
Hi LRUG, | |
Just a quick note, the yearly "Just got back from holiday, oh God we need more development done" contracts rush has come and we've been inundated with requests for upper-Mid level & Senior Ruby and/or Javascript contractors. |
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
#!/bin/bash -l | |
for RUBY in `rvm list strings` | |
do | |
rvm use $RUBY | |
for GEMSET in `rvm gemset list | grep -E '^ ' | grep -v '*'` | |
do | |
rvm --force gemset delete $GEMSET | |
done | |
done |
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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
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
package main | |
func main() { | |
for i:= 1; i <= 100; i++ { | |
if (i % 3 == 0) && (i % 5 == 0) { | |
println("FizzBuzz") | |
} else if i % 3 == 0 { | |
println("Fizz") | |
} else if i % 5 == 0 { | |
println("Buzz") |
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
HITS=`echo "stats" | nc 127.0.0.1 11211 | grep get_hits | awk '{print $3}' | sed 's/[^0-9]//'` | |
MISSES=`echo "stats" | nc 127.0.0.1 11211 | grep get_misses | awk '{print $3}' | sed 's/[^0-9]//'` | |
echo "($MISSES * 100) / ($HITS + $MISSES)" | bc |
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
# MAC manipulators | |
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
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
require 'net/http' | |
require 'rack' | |
# todo | |
# - detect ssl | |
# - keepalive? | |
module Rack | |
class Forwarder | |
def initialize(host, port=80) |
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
// Matraka's source code decoded and beautified | |
// by @tlack | |
// | |
// Matraka is a 1005 byte Javascript "demo" by p01. It includes an 'evolving animation' | |
// and great dirty synth music. View here: | |
// | |
// http://www.p01.org/releases/MATRAKA/matraka.png.html | |
// | |
// I fondly recall the demo scene of my youth, puzzling over the work of Future | |
// Creators and those guys. I was puzzled by this worked so I had to figure it |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'twitter' # 1.0 | |
Twitter.configure do |config| | |
config.consumer_key = '' | |
config.consumer_secret = '' | |
config.oauth_token = '' | |
config.oauth_token_secret = '' |