Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.
The date in [xkcd's comic number 1340][1] [does not change][2].
# coding: utf-8 | |
# copyright 2014 tshirtman | |
# distributed under the GPL licence | |
from __future__ import division | |
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.properties import ListProperty, NumericProperty, StringProperty | |
from kivy.clock import Clock |
Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.
The date in [xkcd's comic number 1340][1] [does not change][2].
#!/bin/bash | |
rm -rf /Volumes/ramdisk | |
if [[ $(mount | awk '$3 == "/Volumes/ramdisk" {print $3}') != "" ]]; then | |
echo /Volumes/ramdisk is mounted | |
else | |
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://8475854` | |
fi |
/** | |
* Bind and Trigger custom and native events in Prototype | |
* @author Juriy Zaytsev (kangax) | |
* @author Benjamin Lupton (balupton) | |
* @copyright MIT license | |
**/ | |
(function(){ | |
var eventMatchers = { | |
'HTMLEvents': /^(?:load|unload|abort|error|select|hashchange|popstate|change|submit|reset|focus|blur|resize|scroll)$/, |
"""GitHub flavoured markdown: because normal markdown has some vicious | |
gotchas. | |
Further reading on the gotchas: | |
http://blog.stackoverflow.com/2009/10/markdown-one-year-later/ | |
This is a Python port of GitHub code, taken from | |
https://gist.github.com/901706 | |
To run the tests, install nose ($ easy_install nose) then: |
import inspect | |
def marmoset_patch(func, s, r): | |
source = inspect.getsource(func).replace(s, r) | |
exec source in func.func_globals | |
func.func_code = func.func_globals[func.__name__].func_code | |
def foo(): | |
print 1 | |
print 2 |
import re | |
import random | |
CURLY_RE = re.compile( "\{(.*?)\}" ) | |
def spam( filename ): | |
file = open(filename, "r") |
# Based on https://github.com/kripken/emscripten/wiki/Tutorial | |
# prerequisites | |
cd ~/ | |
brew install node | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python2 | |
curl http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz > llvm.tgz | |
tar xzvf llvm.tgz | |
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm |
macro makeString { | |
case { _ $tok } => { | |
return [makeValue(#{$tok}[0].token.value, #{here})] | |
} | |
} | |
macro qw { | |
rule { ($delimited ...) } => { [$(makeString $delimited) (,) ...] } | |
} | |
qw(space separated words) // ["space", "separated", "words"] |
/usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -C < foo.js |