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
panties in the desk drawer by the water and the bed and the books | |
i doubt that this qualifies as "a" "poem" but that | |
is probably not the right way to think about it | |
this bed is amazingly soft and the air conditioner makes me jealous | |
in the dark in the dark in the dark in the dark | |
it would be cool to have a different animal's ears, like a beagle or a bug (????) | |
do you want a ricola or no | |
does liking the gore in dead space ii make me a bad person | |
this is line 316 and you're not a line actually | |
i think at this point i'm probably my own dad |
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
class LinkedList(object): | |
def __init__(self): | |
self.head = None | |
self.tail = None | |
self.count = 0 | |
def prettyprint(self): | |
"""iterate and print from head to taill""" | |
node = self.head | |
while node: |
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/python | |
import argparse | |
import json | |
import os | |
from os.path import expanduser | |
import urllib | |
import urllib2 | |
args = None |
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
// ttime is the global timer, a floating point number of seconds | |
for(int i = 0; i < numSprites; i++){ | |
sprites[i]->SetAngle(sprites[i]->GetAngle() + .04); | |
sprites[i]->SetPosition(spm::vec2( | |
anchorPoint.m[0] + 20 * i * sin(i * .01f * ttime), | |
anchorPoint.m[1] + 20 * i * cos(i * .01f * ttime) | |
)); | |
sprites[i]->Draw(frame); | |
} |
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
private String JsonEncode(Map<String, Object> map){ | |
ObjectMapper mapper = new ObjectMapper(); | |
String ret = null; | |
try { | |
StringWriter strWriter = new StringWriter(); | |
mapper.writeValue(strWriter, map); | |
ret = strWriter.toString(); | |
} catch (JsonGenerationException e) { | |
e.printStackTrace(); | |
} catch (JsonMappingException e) { |
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
static int iter = 0; | |
for(int j = 0; j < 6; j++){ | |
for(int i = 0; i < texture->getContentSize().width; i++){ | |
float width = 127; | |
float red = sin(.05*i*PerlinNoise::noise(i*.005+iter*.005*j, i*.01) + 0) * width + 128; | |
float grn = sin(.05*i*PerlinNoise::noise(i*.005+iter*.005*j, i*.01) + 2) * width + 128; | |
float blu = sin(.05*i*PerlinNoise::noise(i*.005+iter*.005*j, i*.01) + 4) * width + 128; | |
ccColor4B color = ccc4(red, grn, blu, 255); | |
texture->setPixelAt(CCPoint(i+.03*(texture->getContentSize().width-i)*PerlinNoise::noise((i+iter)*.03, 10*j), | |
lineHeight+(j*(texture->getContentSize().height/6))+((texture->getContentSize().width-i)*.4)* |
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 datetime as dt | |
from tornado.testing import AsyncHTTPTestCase | |
class CachedTestCase(AsyncHTTPTestCase): | |
responses = {} | |
def cache_response(self, key, response): | |
self.responses[key] = {} |
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
/** | |
* You will need to change the package name to fit your game | |
*/ | |
package | |
{ | |
import org.flixel.FlxCamera; | |
import org.flixel.FlxG; | |
/** | |
* ZoomCamera: A FlxCamera that centers its zoom on the target that it follows |
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
# coding: utf-8 | |
# https://github.com/jedie/python-creole | |
# convert a rest file to HTML (for blog) | |
import sys | |
import os.path | |
import re | |
from creole.rest2html.clean_writer import rest2html |
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
"""urltools.py - parse and format web URLs. | |
HINT: | |
>>> "http://google.com".split("://") | |
["http", "google"] | |
>>> "google.com/hangout/parsely.com/am".split("/") | |
["google.com", "hangout", "parsely.com", "am"] |
OlderNewer