Skip to content

Instantly share code, notes, and snippets.

twitter.com##[aria-label="Timeline: Trending now"]
twitter.com##[aria-label="Relevant people"]
twitter.com##[aria-label="Search and explore"]
twitter.com##[aria-label="Footer"]
twitter.com##[aria-label="Who to follow"]
@sankara
sankara / keybase.md
Last active February 20, 2017 21:32

Keybase proof

I hereby claim:

  • I am sankara on github.
  • I am sankara (https://keybase.io/sankara) on keybase.
  • I have a public key ASBZktgMH9R8UcbArCndHB2Bu9PwPIBwe8UBIuOXmSE-0go

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@sankara
sankara / wget-fail.log
Created June 27, 2012 00:29
wget install failure
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by wget configure 1.13.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
## --------- ##
## Platform. ##
@sankara
sankara / get-scores.pl
Created March 24, 2011 12:11
Fetches score for the latest match. Not configurable
#!/usr/bin/perl
use Data::Dumper;
use LWP::Simple;
use JSON;
$handle = "http://json-cricket.appspot.com/score.json";
#my $str = '{ "batting_team": "Australia", "date": "Mar 24, 2011", "match": "Australia vs India", "score": "Australia 51-1 (12.4)", "summary": "B Haddin(22) *R Ponting(3)*" }';
my $str = get($handle);