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 os.path | |
import requests | |
from PIL import Image | |
lowest_x = 928 | |
highest_x = 1002 | |
lowest_y = -1088 | |
highest_y = -1069 |
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
from pyweaving import Draft | |
from pyweaving.render import ImageRenderer | |
# 1-indexed | |
threading = [ | |
4, 3, | |
6, 5, | |
8, 7, | |
1, 2, 3, 4, 5, 6, 7, 8, | |
2, 1, |
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
""" | |
The basic idea here is to wrap a Python function (in the case below, it is | |
``do_programming_crap()``) and make a basic GUI interface to call that | |
function. | |
Theoretically, it's much easier to create a packaged executable which is only | |
dependent on Pyramid vs. depending on something like PyGTK, WxWidgets, Kivy, | |
SDL, whatever. | |
""" |
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
--- src/dumb/dumb_input.c.orig 2002-10-26 20:44:10.000000000 -0500 | |
+++ src/dumb/dumb_input.c 2012-07-26 07:27:34.000000000 -0500 | |
@@ -79,7 +79,7 @@ | |
/* Read one line, including the newline, into s. Safely avoids buffer | |
* overruns (but that's kind of pointless because there are several | |
* other places where I'm not so careful). */ | |
-static void getline(char *s) | |
+static void frotz_getline(char *s) | |
{ | |
int c; |
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
>>> from mako.template import Template | |
>>> | |
>>> templ = Template(''' | |
... % for el in els: | |
... <p>${el}</p> | |
... % else: | |
... <p>No elements.</p> | |
... % endfor | |
... ''') | |
>>> |
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
" Python indent file | |
" Language: Python | |
" Maintainer: Eric Mc Sween <em@tomcom.de> | |
" Original Author: David Bustos <bustos@caltech.edu> | |
" Last Change: 2012 Aug 15 | |
" | |
" Updated 2012 Aug 15 by Scott Torborg <storborg@gmail.com> | |
" - Adds support for more esoteric PEP8 indentation conditions, particularly | |
" E125 and E127. |
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
#include <pthread.h> | |
#include <stdio.h> | |
#define NUM_WAITING_THREADS 20 | |
#define NUM_WORKING_THREADS 20 | |
pthread_mutex_t quux; | |
void waste_some_time(int cycles) { |
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
(function() { | |
/* Update date_input plugin so that MM/DD/YYYY format is used. */ | |
$.extend($.fn.datepicker.defaults, { | |
parse: function (string) { | |
var matches; | |
if ((matches = string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/))) { | |
return new Date(matches[3], matches[1] - 1, matches[2]); | |
} else { | |
return null; | |
} |
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
""" | |
Poor man's firehose: use your friends to grab twitter data, bypassing the IP | |
rate limit by using a bunch of different clients. This works by serving up | |
javascript which will make the client grab a JSONP feed from twitter and then | |
re-submit it to your server. | |
Obviously, modify this to be more useful, e.g. by setting the page to | |
auto-refresh itself or use long polling to get more URLs to fetch. | |
Call this like: |
NewerOlder