Skip to content

Instantly share code, notes, and snippets.

Philipp Otto philippotto

  • Berlin
Block or report user

Report or block philippotto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
unpoetic-circle / Tab Context.sublime-menu
Last active Jul 24, 2019
Sublime Text 3 Plugin: Close all saved tabs
View Tab Context.sublime-menu
{ "caption": "-" },
{ "command": "close_saved", "caption": "Close Saved Files" }
matttti / effect-generators.js
Created Jan 28, 2017
[redux-saga]: flow-typing of yield return values
View effect-generators.js
import * as IOEffects from 'redux-saga/effects'
export function * select (...args) {
return yield
export function * put (...args) {
return yield IOEffects.put(...args)
nphyx / test-DataView_Uint42Accessors.js
Created Sep 14, 2015
Unit test for unsigned 24-bit int accessors for Javascript DataViews.
View test-DataView_Uint42Accessors.js
describe("DataView", function() {
it("should implement Uint24 accessors", function() {
var i, n, buf, dv;
buf = new ArrayBuffer(3);
dv = new DataView(buf);
n = Math.pow(2, 24);
// this should give us decent coverage without trying every single number, which takes forever
for(i = 1; i < n; i += 111) {
dv.setUint24(0, i);
yuanqing / gist:87bceacedde4dbd96fab
Last active Sep 11, 2019
Sublime Text: Wrap Selection in Backticks
View gist:87bceacedde4dbd96fab
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
mobilemind /
Last active Sep 20, 2019
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
thomassuckow / karma.js
Last active Jun 18, 2017
Using karma to load requirejs tests with the .spec.js suffix. Note the base url needs the / otherwise karma-requirejs will whine about no timestamp (paths will differ) We mangle the files list to be relative, otherwise using relative paths in the form of "./bar" will fail. In my use case I have a shared config.js file that has more configuration…
View karma.js
var tests = Object.keys(window.__karma__.files).filter(function (file) {
return /\.spec\.js$/.test(file);
return file.replace(/^\/base\/src\/js\/|\.js$/g,'');
baseUrl: '/base/src/js',
paths: {
matthiasg / docs style (bootstrap)
Created Aug 5, 2013
the callouts from the bootstrap documentation
View docs style (bootstrap)
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
amitchhajer / Count Code lines
Created Jan 5, 2013
Count number of code lines in git repository per user
View Count Code lines
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
walkermatt /
Created Jun 4, 2012
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
spicycode / tmux.conf
Created Sep 20, 2011
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
You can’t perform that action at this time.