Skip to content

Instantly share code, notes, and snippets.

@dekz
dekz / fstash.zsh
Last active April 12, 2023 00:15
fzf + git stash
fstash() {
local out q k sha
while out=$(
git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" |
fzf --ansi --no-sort --query="$q" --print-query \
--expect=ctrl-d,ctrl-b);
do
IFS=$'\n'; set -f
lines=($(<<< "$out"))
unset IFS; set +f
@abaldwin99
abaldwin99 / triangle_game.py
Last active November 28, 2017 15:31
Cracker Barrel Peg Game / Triangle Game Solution
"""
A small script that finds the solution to the cracker barrel peg game / triangle game.
Instructions along with one of the game's solution can be found here:
http://www.joenord.com/puzzles/peggame/
The solution is determined by building a game tree and using a depth-first search algorithm.
Game Tree: https://en.wikipedia.org/wiki/Game_tree
Depth First Search: https://en.wikipedia.org/wiki/Depth-first_search
@anthonysterling
anthonysterling / Vagrantfile
Last active April 29, 2020 15:28
Handy Vagrantfile for IE testing with Vagrant.
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",