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 MathKit | |
let p = SimplePolynomial(string: "3x^2 + x + 1") | |
let p2 = SimplePolynomial(string: "(x)(y)") | |
let p3 = SimplePolynomial(string: "thisIsOneLongVariable^2") | |
p + p2 // returns 3x^2 + x + (x)(y) + 1 | |
p - p2 // returns 3x^2 + x - (x)(y) + 1 | |
p * p2 // don't feel like figuring that one out. |
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 CSSScanner(e) { | |
this.init(e) | |
} | |
function CSSParser(e) { | |
this.mToken = null, this.mLookAhead = null, this.mScanner = new CSSScanner(e), this.mPreserveWS = !0, this.mPreserveComments = !0, this.mPreservedTokens = [], this.mError = null | |
} | |
function jscsspToken(e, t, n) { | |
this.type = e, this.value = t, this.unit = n |
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 | |
dictionary="/usr/share/dict/words" | |
# usage: scrabble.py <letters> | |
# also, pass it through grep if you want more complex patterns. Personally, my regex-fu isn't that strong. | |
# for the most part, I'll do something like './scrabble.py oschwi*us | grep 'us$' for a word ending in us. | |
# that's about the extent of my regex-fu | |
def readDict(diction=dictionary): |
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$ ./stlparser untitled.stl | |
(triangle 0:) | |
Normal: 0.000000, 0.000000, -1.000000 | |
Vertex 0: 4.341105, 20.788564, 0.000000 | |
Vertex 1: -19.261895, 0.018564, 0.000000 | |
Vertex 2: -19.261895, 20.788564, 0.000000 | |
(triangle 1:) | |
Normal: 0.000000, 0.000000, -1.000000 | |
Vertex 0: -19.261895, 0.018564, 0.000000 | |
Vertex 1: 4.341105, 20.788564, 0.000000 |
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$ ./stlparser untitled.stl | |
stlparser(71086,0x7fff77ac2310) malloc: *** error for object 0x7fbcd8d007a8: incorrect checksum for freed object - object was probably modified after being freed. | |
*** set a breakpoint in malloc_error_break to debug | |
Abort trap: 6 | |
you$ ./stlparser untitled.stl # no change to the code/binary. | |
<normal output> |
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/local/bin/python | |
from webhelpers.feedgenerator import Atom1Feed | |
import os | |
import datetime | |
def genPost(webRoot, homeDir): | |
f = open(homeDir + "flightSim/post1.html") | |
idx = f.read() | |
f.close() |
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 | |
from PIL import Image | |
import math | |
import requests | |
import StringIO | |
def deg2num(lat_deg, lon_deg, zoom): | |
lat_rad = math.radians(lat_deg) | |
n = 2.0 ** zoom |
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 bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <reponame>" | |
else | |
echo "creating $1.git" | |
mkdir $1.git | |
cd $1.git | |
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 | |
pushd ~/foo/twIRCk/ # change this to wherever you keep your twIRCk sources. | |
git pull origin master | |
# removing the mac app store signing | |
cp TwIRCk.xcodeproj/project.pbxproj backup.pbxproj | |
sed '/CODE_SIGN_IDENTITY/d' < TwIRCk.xcodeproj/project.pbxproj >> new.pbxproj | |
mv new.pbxproj TwIRCk.xcodeproj/project.pbxproj | |
xcodebuild -target twIRCk |
NewerOlder