This file contains hidden or 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
import tornado.httpclient | |
from urllib import urlencode | |
from hashlib import md5 | |
def admob_ad(request, admob_params=None): | |
""" | |
Given a Tornado ``self.request`` object and dict of | |
admob parameters returns a Admob ad. | |
If no ad can be retrieved displays a one pixel |
This file contains hidden or 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
import tornado.httpclient | |
from urllib import urlencode | |
from hashlib import md5 | |
class admobAsync(): | |
""" | |
Does admob ad requests asynchronously. I don't know if this is the right way to do this, but I found it handy. Based on: http://www.djangosnippets.org/snippets/883/ | |
Use this class as RequestHandler a mixin like so: | |
This file contains hidden or 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/python | |
# This monstrosity was created to sync events from my Work calendar to my main calendar using the google data apis | |
try: | |
from xml.etree import ElementTree | |
except ImportError: | |
from elementtree import ElementTree | |
import gdata.calendar.service | |
import gdata.service |
This file contains hidden or 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
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
MAKEFLAGS: -j2 | |
==> Checking out http://v8cgi.googlecode.com/svn/trunk/ | |
/usr/bin/svn up --force http://v8cgi.googlecode.com/svn/trunk/ /Users/moshen/Library/Caches/Homebrew/v8cgi--svn |
This file contains hidden or 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
# Based on Bruce Cooper's postsbydate.rb | |
# https://github.com/brucejcooper/8bitcloud.com/blob/master/_plugins/postsbydate.rb | |
# http://www.8bitcloud.com/2010/12/29/posts-in-tree.html | |
module Jekyll | |
class Site | |
# Sort posts by category and date | |
def postsbycategory | |
categories = [] | |
self.categories.sort.each do |category_name, posts| |
This file contains hidden or 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
--- | |
layout: default | |
title: Posts by date | |
--- | |
<h1>{{ page.title }}</h1> | |
{% for year in site.postsbyyear %} | |
{% for month in year.months %} | |
<h2>{{ month.name }} {{ year.number }}</h2> | |
<ul class="clickList"> |
This file contains hidden or 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
#!python | |
# This monstrosity was created to sync events from my Work calendar ical feed to a google calendar | |
# Google Calendar already supports ical feeds you say? Well... it would be nice if they | |
# updated them every once and awhile. | |
try: | |
from xml.etree import ElementTree | |
except ImportError: | |
from elementtree import ElementTree |
This file contains hidden or 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 perl | |
use warnings; | |
use strict; | |
# Animation frames... | |
# Color ASCII escape sequences, gzipped and base64 encoded, because | |
# I thought 300 lines of animation frames was a little much. | |
my @frames = ( q( | |
H4sIAHywIU8AA+1d23XkOA797xT8oxBst+11z4QyMVQO+7ExbIAbydrdVXqCeJOEKNQZnzMURIq4 | |
BEAU6jb19M/b59/vfz/fnv78z8uvj9u0+zz98yUFrrI6PG473nX8wA/68cSYI+fze/hlNkvz9fWV |
This file contains hidden or 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
execve("/home/colin/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1", ["/home/colin/perl5/perlbrew/perls"..., "-t", "-Ilib", "t/basic-tcp.t"], [/* 60 vars */]) = 0 | |
brk(0) = 0xb13000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd06569b000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=36652, ...}) = 0 | |
mmap(NULL, 36652, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd065692000 | |
close(3) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) |
This file contains hidden or 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
execve("/home/colin/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1", ["/home/colin/perl5/perlbrew/perls"..., "-t", "-Ilib", "t/handle-basic-tcp.t"], [/* 60 vars */]) = 0 | |
brk(0) = 0x11f3000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5dc2ec6000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=36652, ...}) = 0 | |
mmap(NULL, 36652, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5dc2ebd000 | |
close(3) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) |
OlderNewer