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/sh | |
# Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
# Install required libs | |
apt-get -y install build-essential python-dev libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms1-dev | |
# Link to correct location | |
if [ -d /usr/lib/x86_64-linux-gnu ]; then | |
# Ubuntu 11.04 64bit | |
ln -sf /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
protocol AccountLike: Equatable { | |
var accountID: String {get} | |
} | |
class Account : AccountLike { | |
let accountID = nil |
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 python | |
# | |
# Jamie Kirkpatrick, November 2009. <jkp@kirkconsulting.co.uk> | |
# Released under the BSD license. | |
# | |
""" | |
Experimental code to add asyncronous functionality to WSGI applications | |
running under the Tornado webserver. Uses greenlet to spin micro-threads | |
which can be suspended and resumed within a single thread as required. |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>untitled</title> | |
<link rel="stylesheet" href="" /> | |
</head> | |
<body> | |
<script src=""></script> |
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/sh | |
# Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
# Uninstall PIL | |
# sudo pip uninstall PIL -q | |
# Install required libs | |
apt-get --yes install build-essential python-dev zlib1g-dev liblcms1-dev libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev | |
# Link to correct location |
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
''.join(random.sample(string.letters+string.digits, 40)) |
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
// | |
// TMSerialAnimationQueue.h | |
// Orangina | |
// | |
// Created by Bryan Irace on 10/9/13. | |
// Copyright (c) 2013 Tumblr. All rights reserved. | |
// | |
/** | |
Contains boilerplate for performing animations serially, without blocking the main thread. |
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
import Foundation | |
var token: dispatch_once_t = 0 | |
func test() { | |
dispatch_once(&token) { | |
println("This is printed only on the first call to test()") | |
} | |
println("This is printed for each call to test()") | |
} |
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
import operator | |
def build_book_inventory(book_ids, shops): | |
shop_labels = map(operator.itemgetter('label'), shops) | |
books = Persistency.books_table.read(shops=shop_labels, books=book_ids) | |
inventory = {} | |
for book in books: | |
shop_inventory = inventory.setdefault(book['shop_label']) | |
book_inventory = shop_inventory.setdefault(book['cell_label'], {}) |
OlderNewer