Skip to content

Instantly share code, notes, and snippets.

View lavie's full-sized avatar

assaf lavie

View GitHub Profile
@lavie
lavie / gist:06f6e867570ca875442f
Last active August 29, 2015 14:22
pythonify vim
:syntax on
:filetype indent plugin on
:set filetype=python
:set tabstop=4
:set expandtab
:set shiftwidth=4
:set softtabstop=4
:set modeline
@lavie
lavie / delete_stale_images.sh
Last active April 24, 2017 23:57
Free disk space by deleting "stale" docker images (keep around the latest N tags of each image)
#!/bin/bash
images=$(./stale_image_tags.sh my.repo 3)
for image in $images; do
docker rmi $image
done
@lavie
lavie / .tmux.conf
Last active February 13, 2016 18:24
unbind Up
unbind Right
unbind Left
unbind Down
bind l select-pane -R
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
unbind C-b
set -g prefix C-a
@lavie
lavie / -
Created February 14, 2016 18:35
1fcaf9fb0cf37b186a79
#!/bin/bash
OUTPUT=$(docker ps --filter "status=running" --format "{{.Names}}")
NAMES=($OUTPUT)
i=1
echo "Please choose the container to BASH into:"
for name in $OUTPUT; do
echo "$i) $name"
(( i++ ))
done
@lavie
lavie / -
Created April 17, 2016 20:30
This file has been truncated, but you can view the full file.
mo givo meelo ibea igoa ogev pd etaono voro unueto oda dte inuopo ubiu onei ibou vuga uola vmu ir mee zea aneni rf tooka fer pae uke se omiezi afe ia ae urie ii ria nae tot okeb fvi oguru firi edis ikie muo goiso poaki eu vul ubao kt zeera laisu nra imuoze lf iaga fu gte ubaoti esin zuufu avi sr ua iziaka odoimo mio io rlu ozofo veka kela uler ng pa ii unui gafi mab ek otez lfu ou vbe neza udi vebo leso kao toke unoe oofo epuese ifefa rl el ne guesa opefi ip nozu er omu ekonu zab ikeifo emaagi orise ateisa mzo pse ufua pre ipaso figi dm sub zf pabo kobo biulo tui agal ilu sate muf loo lnu geu io uvena bam udoa ifi suida ia apua okaz tuki uzoefa ouvu ii ele opoofe vusu gu koono ulaozo bpu un ekomi afeu ega op uodo kz usap ruuno gii iko tif guf ozami im bv ikus loo ifiu ee leu ida kao aeko vueda dou rera zar zt sn anib orup afoomo uteo lu ozaufa bogo epa uo lefe sas izoa fu olipa soko avegi val tte fdu eba peu ireg vovo oida rova nano lke ine zai eta guro bov poudu rg aore tu ra re zubi kno nia foza ruori fp ag
import sys
import itertools
from random import choice
consonants = "rtpklgfdszbvnm"
vowels = ["a", "e", "i", "o", "u"]
def half_syl():
return choice(list(consonants)) + choice(vowels)
#!/bin/bash
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
#!/bin/bash
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
@lavie
lavie / search_results.js
Last active July 1, 2016 05:58
Adds prefix to google search result links, so they're easier to hit with Vimium
// ==UserScript==
// @name Google Search Result Markers
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds prefix to Google search result links, to make it easier to hit them with Vimium
// @author Assaf Lavie
// @match https://*.google.co.il/*
// @match https://*.google.com/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none