Skip to content

Instantly share code, notes, and snippets.

💭
🤖

Joe Crawford artlung

💭
🤖
View GitHub Profile
View app-app-store-argument.js
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var meta = document.getElementsByTagName('meta');
var apple_launch_elem;
for (var i=0;i < meta.length; i++) {
var elem = meta[i];
@artlung
artlung / zodiac-fragment.py
Created Mar 21, 2012 — forked from anonymous/zodiac.py
ZODIAC.PY FRAGMENT
View zodiac-fragment.py
def main():
name = raw_input ("Enter Your Name: ")
month = raw_input("Enter Birth Month: ")
day = int(raw_input("Enter Birth Day of Month: "))
if month == "March":
if day > 20:
print "Aries"
else:
print "Pisces"
View charcount.py
# displays alphanumeric character count and sum of digits in file
import sys
if len(sys.argv) < 2:
print "Usage: python charcount.py <input.txt>"
exit()
f = open(sys.argv[1])
@artlung
artlung / gist:587176
Created Sep 19, 2010 — forked from alandipert/gist:585336
challenge in clojure
View gist:587176
;;; FIRST CHALLENGE
(defn challenge1
"Given file name f reads it and prints statistics."
[f]
(let [{numbers false letters true} (group-by #(nil? (re-matches #"\d*" %))
(clojure.contrib.duck-streams/read-lines f))
letter-freqs (frequencies letters)
sum (reduce + (map #(Integer/parseInt %)
numbers))]
You can’t perform that action at this time.