Skip to content

Instantly share code, notes, and snippets.


я котик пур-пур mvasilkov

View GitHub Profile
# coding: utf-8
# copyright 2014 tshirtman
# distributed under the GPL licence
from __future__ import division
from import App
from kivy.lang import Builder
from import ListProperty, NumericProperty, StringProperty
from kivy.clock import Clock
hausen / gist:9501041
Last active Aug 29, 2015
"Fixing" xkcd 1340 (or making the most redonkulous clock ever)
View gist:9501041

"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

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].

View gist:a0cf0545a2adca1d28b3
rm -rf /Volumes/ramdisk
if [[ $(mount | awk '$3 == "/Volumes/ramdisk" {print $3}') != "" ]]; then
echo /Volumes/ramdisk is mounted
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://8475854`
balupton / bind.trigger.prototype.js
Created Jan 26, 2011
Bind and Trigger Custom and Native Events in Prototype
View bind.trigger.prototype.js
* Bind and Trigger custom and native events in Prototype
* @author Juriy Zaytsev (kangax)
* @author Benjamin Lupton (balupton)
* @copyright MIT license
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
Further reading on the gotchas:
This is a Python port of GitHub code, taken from
To run the tests, install nose ($ easy_install nose) then:
View gist:2317969
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
# -*- coding: utf-8 -*-
from PIL import Image, ImageMath
def paste_composite(original, paste):
Вставляет в первое изображение второе, с учетом альфаканала обоих.
Оба изображения должны быть в формате RGBA.
CamDavidsonPilon /
Last active Dec 16, 2015
using data from as `filename`, will create a random comment.
import re
import random
CURLY_RE = re.compile( "\{(.*?)\}" )
def spam( filename ):
file = open(filename, "r")
dweekly / gist:5873953
Last active Dec 19, 2015
Get Emscripten Running on OS X 10.8
View gist:5873953
# Based on
# prerequisites
cd ~/
brew install node
sudo ln -s /usr/bin/python2.7 /usr/bin/python2
curl > llvm.tgz
tar xzvf llvm.tgz
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm
View qw.sweet.js
macro makeString {
case { _ $tok } => {
return [makeValue(#{$tok}[0].token.value, #{here})]
macro qw {
rule { ($delimited ...) } => { [$(makeString $delimited) (,) ...] }
qw(space separated words) // ["space", "separated", "words"]
You can’t perform that action at this time.