Skip to content

Instantly share code, notes, and snippets.

View iki's full-sized avatar

Jan Killian iki

View GitHub Profile
@ahmednuaman
ahmednuaman / default.js
Created January 6, 2015 16:00
Getting BrowserSync and gulp-watch to play nicely
var browserSync = require('browser-sync'),
common = require('./__common__'),
gulp = require('gulp'),
watch = require('gulp-watch');
gulp.task('default', [
'less'
], function () {
browserSync({
server: {
@goatslacker
goatslacker / transforms-with-alt.js
Last active August 29, 2015 14:20
Nuclear-style transforms for Alt stores
import Alt from './'
// the magic sauce
import { createTransform } from './utils/frp'
// decorator utilities
import { createStore, bind } from './utils/decorators'
const alt = new Alt()
@strobemonkey
strobemonkey / css3-buttons.styl
Created March 8, 2011 15:49
CSS3 buttons in Stylus
// based on http://css3-buttons.heroku.com/
border-radius()
-webkit-border-radius arguments
-moz-border-radius arguments
border-radius arguments
box-shadow()
-webkit-box-shadow arguments
-moz-box-shadow arguments
#!/usr/bin/env python
"""Test wordlist parsing speed.
See http://news.ycombinator.com/item?id=2716714
Use with /usr/share/dict/words,
or e.g. http://www.freebsd.org/cgi/cvsweb.cgi/src/share/dict/web2?rev=1.14;content-type=text/plain
"""
import pickle
@filippo
filippo / accept_languages.py
Created July 26, 2011 10:57
decode HTTP_ACCEPT_LANGUAGE headers
def accept_languages(browser_pref_langs):
"""Parses the request and return language list.
browser_pref_langs is the plain Accept-Language http request header
value.
Stolen from Products.PloneLanguageTool, under GPL (c) Plone Foundation,
slightly modified.
Taken from tweetengine http://github.com/Arachnid/tweetengine/
"""
browser_pref_langs = browser_pref_langs.split(',')
i = 0
@brysgo
brysgo / ndb_json.py
Created January 6, 2012 21:47
(THIS IS REALLY OLD AND OUTDATED) A port of the app engine json serializer for NDB.
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jsahlen
jsahlen / Gemfile
Created February 14, 2012 15:14
My Guard-based build system for front-end assets – see my blog post at http://monospace.se/posts/guard-build-system
source :rubygems
# V8 JavaScript Engine (for Uglifier)
gem "therubyracer"
# SASS & Compass
gem "sass", "~> 3.2.0.alpha"
gem "compass"
# For concatenation/compression
function refreshLink(link) {
var instance = this;
var pageDomain = window.location.href.match(/\/\/([^\/]+)/);
var linkDomain = link.href.match(/\/\/([^\/]+)/);
if (!pageDomain || !linkDomain || pageDomain[1] != linkDomain[1]) {
return instance;
}
@michaelgwelch
michaelgwelch / link_story2.user.js
Created March 24, 2012 16:13
A greasemonkey script that creates a link from commit to story on pivotal tracker
@jed
jed / adler32.js
Created July 21, 2012 05:03
non-obfuscated adler32
function adler32(string) {
var length = string.length
, modulus = 65521
, index = 0
, a = 1
, b = 0
while (index < length) {
a += string.charCodeAt(index++)
a %= modulus