Skip to content

Instantly share code, notes, and snippets.


Thomas Schranz tosh

View GitHub Profile
tosh / day4.cljs
Created Dec 4, 2017
View day4.cljs
(defn input [r]
(->> (.split r "\n")
(map #(.trim %))
(map #(.split % " "))))
(defn anagram? [a b]
(= (frequencies a)
(frequencies b)))
(defn valid? [passphrase]
View tab_title_change.js
document.addEventListener('visibilitychange', function(event) {
if (document.hidden) {
document.title = 'woohoo';
} else {
document.title = 'old title';
tosh /
Last active Dec 10, 2015 — forked from amscotti/
MD5 hashing
crypto = require('crypto');
#Quick MD5 of text
text = "MD5 this text!"
md5hash1 = crypto.createHash('md5').update(text).digest("hex")
#MD5 of text with updates
m = crypto.createHash('md5')
m.update("MD5 ")
m.update("this ")
View gist:9866379
### Keybase proof
I hereby claim:
* I am tosh on github.
* I am tosh ( on keybase.
* I have a public key whose fingerprint is 502D 6C0F D8F6 7DA0 D77E F845 8083 24CE 6C92 3A14
To claim this, I am signing this object:
tosh / iso dates py -> js
Created Mar 21, 2011
convert python dates into iso strings for javascript
View iso dates py -> js
def dto(self):
Data Transfer Object
datetimes are serialized to
return dict(key=self.key().name(),,
tosh / Designer
Created Jan 17, 2011
we are searching for someone who loves HTML and CSS
View Designer
we ( need you if you:
* love HTML
* dig CSS
* think you can assemble a kickass team of frontend devs (we want people who love what they do)
* want to work on projects with challenging deadlines
* want to create facebook and mobile web apps for big brands (red bull, krone, ditech, jim beam, …)
* like to experiment with new stuff (e.g. css3 transform, transition, …)
tosh /
Created Dec 18, 2010
jquery tmpl templating function for use with jammit
# Basically a copy of prior art for mustache
# Add a jquery-tmpl templating function to your CoffeeScript:
window.jammit_jquery_template = (templateString) ->
-> jQuery.tmpl(templateString, arguments[0], arguments[1])
# And then, in assets.yml, you can set "template_function" to "jammit_jquery_template".
You can’t perform that action at this time.