Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am qbyt on github.
  • I am qbyt (https://keybase.io/qbyt) on keybase.
  • I have a public key whose fingerprint is 5D1D BDA9 18BA 0E59 A652 7A3E F488 345F E017 AF78

To claim this, I am signing this object:

Disambiguate news from gossip
--------------
http://www.theguardian.com/film/2014/jan/30/scarlett-johansson-oxfam-quits-sodastream
http://www.dailymail.co.uk/tvshowbiz/article-2173879/Sail-away-Scarlet-Johansson-shows-sign-stepping-holiday-boat-soaks-sun-hunk-like-bodyguard.html
Different types of news (political, scientific, economic)
--------------
http://www.theguardian.com/politics/2014/feb/07/david-cameron-scottish-independence-referendum-olympic-park
class Proc
def self.compose(f, g)
lambda { |*args| f[g[*args]] }
end
def *(g)
Proc.compose(self, g)
end
end
@qbyt
qbyt / gist:2568782
Created May 1, 2012 15:24
tweets + blocks
blocks = range(12)
tweets = ["one", "two", "three"]
def chunk(l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n]
zip(list(chunk(blocks, 3)), tweets)
@qbyt
qbyt / member_xml.py
Created December 15, 2011 09:18
Split your tiresome EE member xml files
#!/usr/bin/env python
# encoding: utf-8
import os
from BeautifulSoup import BeautifulStoneSoup
def brew(path):
""" Creates the brew, extracts the members """
doc = open(path, 'r')
brew = BeautifulStoneSoup(doc)
@qbyt
qbyt / base64-conversion-coffeescript-compiled.js
Created January 12, 2011 15:46
A CoffeeScript port of the Javascript version by Nicholas C. Zakas(2009) - https://github.com/nzakas/computer-science-in-javascript
/*
Base 64 implementation in CoffeeScript (Compiled JS)
Converted from Base 64 implementation in JavaScript - Nicholas C. Zakas (2009)
(https://github.com/nzakas/computer-science-in-javascript)
*/
/*
Base64-encodes a string of text.
@param {String} text The text to encode.
@return {String} The base64-encoded string.