Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Köstlin gizmomogwai

View GitHub Profile
@gizmomogwai
gizmomogwai / kitchen.plantuml
Last active Apr 14, 2018
The Kitchen, dish, dishwasher algorithm
View kitchen.plantuml
@startuml
start
note right: Agent enters the kitchen to bring back a dish (e.g. glass, cup, mug, plate, ...)
if (Dishwasher running?) then (yes)
:Put dish into sink;
stop
else (no)
if (Dishwasher full?) then (yes)
if (Dishes in dishwasher clean?) then (yes)
:Put clean dishes back;
View .gitignore
intellij-community
.DS_Store
*.png
@gizmomogwai
gizmomogwai / copy-lp-user.fish
Created Dec 2, 2016
fish function to copy lastpass username to the clipboard
View copy-lp-user.fish
function copy-lp-name -d "copy lp name"
if lpass ls | fzf > /tmp/fzf.result
set lp_account (cat /tmp/fzf.result | cut -d ' ' -f 1)
set lp_username (lpass show $lp_account | grep 'Username:' | cut -d ' ' -f 2)
echo -n $lp_username | copy
end
end
@gizmomogwai
gizmomogwai / copy-lp-pass.fish
Last active Dec 2, 2016
fish function to copy a lastpass password to the clipboard
View copy-lp-pass.fish
function copy-lp-pass -d "copy lp pass"
if lpass ls | fzf > /tmp/fzf.result
set lp_account (cat /tmp/fzf.result | cut -d ' ' -f 1)
set lp_pass (lpass show $lp_account | grep 'Password:' | cut -d ' ' -f 2)
echo -n $lp_pass | copy
end
end
@gizmomogwai
gizmomogwai / copy.fish
Created Dec 2, 2016
fish function for copy to clipboard
View copy.fish
function copy -d 'copy to clipboard'
switch (uname)
case Linux
xsel --clipboard --input
case Darwin
pbcopy
case '*'
echo "copy not supported for (uname)"
end
end
@gizmomogwai
gizmomogwai / up.fish
Created May 31, 2016
fish function to combine lpass with fzf and pbcopy
View up.fish
function up -d "lastpass user and password"
if lpass ls | fzf > /tmp/fzf.result
cat /tmp/fzf.result
set account_name (cat /tmp/fzf.result | cut -f 1 -d ' ')
lpass show --username $account_name | pbcopy
read -p 'echo username stored in clipboard ... press return to continue'
lpass show --password $account_name | pbcopy
read -p 'echo password stored in clipboard ... press return to continue'
end
end
@gizmomogwai
gizmomogwai / cloud-config.yaml
Created Aug 17, 2015
simple cloud config file
View cloud-config.yaml
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAs5zpVBQD4paP5RVkb6LGsjGjQXANP0S7SUxXkTY4+3Muov651wzcX/VmDHBQFLSmT92PdqSXL2+8HiAvlPxaHohZIsIu7JEOO5yvAeb/y/rw5Gp1ggVieVojLLbhhnZ5ECTR4Wj7/TvQI7IaL0WH8KHzo8Q+nBz1ZzLkIDTjGAfcgwxZ32ieGAea5rDjFouxmIZTisMIdroAZT0M/QvM1GgbXmHaairYLsJJDE1CUI5GjHGLFbCE10qRlXqHMyw6GKkoXiV4LzvnIcQ1J0l7GIWq6vnvy2NWkMBckA/DLnL123Z95676KwIHlzDw11LPzXv1ncwf5lOOWRuLa+OWcw== gizmo@armadillo
@gizmomogwai
gizmomogwai / rt.bash
Created Aug 17, 2015
execute one rake task for bash
View rt.bash
#!/bin/bash
function rt() {
local task
task=$(rake -T | fzf | cut -d ' ' -f 2)
rake $task
}
@gizmomogwai
gizmomogwai / rt.fish
Created Aug 17, 2015
select one raketask with fzf in the fish shell
View rt.fish
function rt -d "select one rake task"
if rake -T | fzf > $TMPDIR/fzf.result
set fzf_result (cat $TMPDIR/fzf.result | cut -d ' ' -f 2)
set h "rake $fzf_result"
commandline $h
end
end
View repo-tig.sh
#!/bin/sh
repo forall -c 'if git status 2> /dev/null | grep -E "modified|deleted|Untracked|Changes"; then pwd; sleep 3;tig status; fi'