Skip to content

Instantly share code, notes, and snippets.

View iki's full-sized avatar

Jan Killian iki

View GitHub Profile
application: zip-site
version: main
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py
@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
@henrik242
henrik242 / p4merge
Last active January 5, 2023 22:23
Helper script for p4merge and Git on MacOSX
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/P4Merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
@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
@jbgo
jbgo / git-recover-branch.md
Last active March 29, 2024 05:04
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
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