Skip to content

Instantly share code, notes, and snippets.

@schtibe
schtibe / git-fuzzy-co.py
Last active January 3, 2017 10:09 — forked from shashwatblack/git-fuzzy-co.py
Git fuzzy checkout with substring matching and case-insensitivity (and colors!)
#!/usr/bin/env python
"""
git fuzzy-checkout
Same as `git checkout branch`, but with fuzzy matching if checkout fails.
Turns `git checkout barnch` into `git checkout branch`,
assuming `branch` is a branch.
"""
import difflib
import sys
@schtibe
schtibe / tny
Last active February 20, 2023 12:57 — forked from gbl08ma/tny
Unix shell script to shorten URLs with tny.im URL shortener. wget must be installed for this to work.
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo "usage: tny long_url [custom_keyword]"
echo ""
echo "Shorten URLs with tny.im URL shortener"
echo "This script expects a long URL to shorten either as an argument or passed through STDIN."
echo "When using arguments, an optional second argument can be provided to customize the later part of the short URL (keyword)."
exit 1
fi
@schtibe
schtibe / profile.sh
Last active December 13, 2015 16:49 — forked from ganwell/profile.sh
# 5000 unique bash history lines that are shared between
# sessions on every command. Happy ctrl-r!!
shopt -s histappend
# Well the python code only does 5000 lines
export HISTSIZE=10000
export HISTFILESIZE=10000
export PROMPT_COMMAND="history -a; unique_history.py; history -r; $PROMPT_COMMAND"
@schtibe
schtibe / gist:1025518
Created June 14, 2011 18:27
MyTypeing in OOPLSS
class A {
def __construct(x: Int) {
self.x = x;
}
def m(): MyType {
return self;
}
def n(): MyType {
return self;
}