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
#!/bin/sh | |
# Fetch and install the latest Chromium mac nightly build, but only | |
# if it's different from the currently installed version. An existing | |
# Chromium.app is backed up to .Chromium.app in the same directory. | |
# | |
# Install with: | |
# $ curl -L http://bit.ly/night-chrome > ~/bin/nightly-chromium | |
# $ chmod +x ~/bin/nightly-chromium | |
# | |
# To upgrade to latest chromium version: |
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 python | |
# encoding: utf-8 | |
""" | |
Reads the image URIs for the various graphs in Google's webmaster tools crawl | |
stats page, and pulls some data estimates from it. | |
$ python gwc_decode.py 'https://www.google.com/chart?...' | |
""" |
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
# New __getattr__ definition for bson/dbref.py to support pickling | |
def __getattr__(self, key): | |
# checking for the mangled name. ugly. | |
if '_DBRef__kwargs' in self.__dict__: | |
try: | |
return self.__kwargs[key] | |
except KeyError: | |
pass |
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
def _element_to_bson(key, value, check_keys): | |
if not isinstance(key, basestring): | |
raise InvalidDocument("documents must have only string keys, " | |
"key was %r" % key) | |
if check_keys: | |
if key.startswith("$"): | |
raise InvalidDocument("key %r must not start with '$'" % key) | |
if "." in key: | |
raise InvalidDocument("key %r must not contain '.'" % key) |
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
# numbers | |
>>> 1 | |
1 | |
>>> 1 + 1 | |
2 | |
>>> 1 - 5 | |
-4 | |
>>> 8 * 9 | |
72 | |
>>> 4 / 2 |
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
// | |
// main.m | |
// nsmutabledict | |
// | |
// Created by Stephen Altamirano on 5/29/12. | |
// | |
#import <Foundation/Foundation.h> | |
NSMutableArray* dict_keys(NSMutableDictionary* d) |
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
($>) = flip ($) | |
-- this defintion is wrong, but is sufficient for our time range | |
leap_year y = y /= 1900 && y `mod` 4 == 0 | |
month_days m y | |
| m == 2 && leap_year y = 29 | |
| m == 2 = 28 | |
| m `elem` [4, 6, 9, 11] = 30 | |
| otherwise = 31 |
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 node | |
var util = require('util'); | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var chunks = []; | |
function unique_chars(str) { | |
var seen = {}, |
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
\documentclass{article} | |
\usepackage{geometry} | |
\usepackage{fancyhdr} | |
\usepackage{amsmath ,amsthm ,amssymb} | |
\usepackage{graphicx} | |
\usepackage{hyperref} | |
\begin{document} | |
Problem 28 can be solved analytically. It's certainly not the most efficient route, |
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
// | |
// Swizzler.m | |
// ZombieFarm | |
// | |
// Created by Stephen Altamirano on 8/16/12. | |
// Copyright (c) 2012 playforge. All rights reserved. | |
// | |
#import <objc/runtime.h> | |
#import "Swizzler.h" |
OlderNewer