Skip to content

Instantly share code, notes, and snippets.

orblivion

Block or report user

Report or block orblivion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am orblivion on github.
  • I am ill_llogic (https://keybase.io/ill_llogic) on keybase.
  • I have a public key whose fingerprint is D053 23BE 2C75 094F 7BA0 17A7 01B0 AEB6 46A0 DF80

To claim this, I am signing this object:

@orblivion
orblivion / gist:057fc395e4d87af97fba
Last active Aug 29, 2015
Recursive lazy fibonacci
View gist:057fc395e4d87af97fba
from itertools import izip, islice
def fibg():
"Generate an infinite amount of fibonacci numbers"
yield 1
yield 1
offset = fibg()
offset.next()
for x, y in izip(offset, fibg()):
yield x + y
View gist:ff31feeb7b66c698f929
pub 4096R/8977C0AC 2013-08-31 [expires: 2014-08-20]
Key fingerprint = 9F2E 8AD5 B382 B7CE 1028 524D AB6E 81FF 8977 C0AC
uid Daniel Krol <orblivion@gmail.com>
sub 4096R/0B2BBEEC 2013-08-31 [expires: 2014-08-20]
==========================================================================
pub 4096R/46A0DF80 2014-06-21 [expires: 2016-06-20]
Key fingerprint = D053 23BE 2C75 094F 7BA0 17A7 01B0 AEB6 46A0 DF80
uid Daniel Krol (Main) <orblivion@gmail.com>
View gist:ad93efa13a2f98e98bcf
pub 4096R/8977C0AC 2013-08-31 [expires: 2014-08-20] pub 4096R/46A0DF80 2014-06-21 [expires: 2016-06-20]
Key fingerprint = 9F2E 8AD5 B382 B7CE 1028 524D AB6E 81FF 8977 C0AC Key fingerprint = 9F2E 8AD5 B382 B7CE 1028 524D AB6E 81FF 8977 C0AC
uid Daniel Krol <orblivion@gmail.com> uid Daniel Krol <orblivion@gmail.com>
sub 4096R/0B2BBEEC 2013-08-31 [expires: 2014-08-20] sub 4096R/0B2BBEEC 2013-08-31 [expires: 2014-08-20]
=======================================================================================================================================================
pub 4096R/46A0DF80 2014-06-21 [expires: 2016-06-20] pub 4096R/46A0DF80 2014-06-21 [expires: 2016-06-20]
Key fingerprint = D053 23BE 2C75 094F 7BA0 17A7 01B0 AEB6 46A0 DF80 Key fingerprint = D053 23BE 2C75 094F 7BA0 17A7 01B0 AEB6 46A0 DF80
uid Daniel Krol (Main) <
View gist:11161808
subscribeSink_ fun =
awaitForever $ (\x ->
case decode (L.fromStrict x) of
Just (SubscribeResponse (resp, _)) -> do
_ <- liftIO $ mapM (onMsg subOpts . fun) resp
return ()
Nothing ->
return ())
subscribeSink = subscribeSink_ id
View gist:964573
data Purse a b c = Purse a b c
data Keys = Keys
data Phone = BlackBerry | IPhone | Android
data Wallet = LeatherWallet Float | MoneyClip Float
addKeys (Purse () b c) keys = Purse keys b c
addPhone (Purse a () c ) phone = Purse a phone c
addWallet (Purse a b ()) wallet = Purse a b wallet
View allcombinations.py
from copy import copy
# allCombinations looks for these to know where there are multiple possibilities
class oneOf(object):
def __init__(self, *options):
self.options = options
# signifies that the element shouldn't be there at all. Don't add it to the list,
# the key shouldn't be there, the attribute shouldn't be there, and so forth.
class leaveOut():
View gist:304335
import imaplib
import getpass
import re
import webbrowser
import sys
mail = imaplib.IMAP4_SSL('imap.gmail.com', 993)
pw = getpass.getpass() # get password
mail.login('example@gmail.com',pw)
View gist:75200
import twitter, re, datetime, PyRSS2Gen
def getURLs(text):
url=unicode(r"((http|ftp)://)?(((([\d]+\.)+){3}[\d]+(/[\w./]+)?)|([a-z]\w*((\.\w+)+){2,})([/][\w.~]*)*)")
return [a.group() for a in re.finditer(url,text)]
def mkFeedItem(url):
return PyRSS2Gen.RSSItem(
title = "Twitter Link",
View calendar.js
/* Loads the Google data JavaScript client library */
google.load("gdata", "1");
function summary(str, maxlen) {
if (str.length > maxlen)
return str.substring(0, maxlen-1) + "...";
else
return str
}
You can’t perform that action at this time.