View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intellij-community | |
.DS_Store | |
*.png |
View kitchen.plantuml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 rt.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 copy-lp-user.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View copy-lp-pass.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View copy.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View up.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View clone_vmware_image.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from = ARGV[0] | |
to = ARGV[1] | |
puts "copy from #{from} to #{to}" | |
def run(cmd) | |
puts "Executing #{cmd}" | |
if !system(cmd) | |
raise "error while executing #{cmd}" | |
end | |
end |
View structs_vs_classes.d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.datetime; | |
import std.stdio : writeln; | |
struct HStruct { | |
size_t c; | |
void add() { | |
c = c % 3 +1; | |
} | |
size_t get() { |
View gist:1014032
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
class ProgressListener | |
def initialize | |
s = Benchmark.bm do |x| | |
x.report('ProgressListener.initialize') do | |
@todo = 0.0 | |
@needed_tasks = {} | |
Rake::application.top_level_tasks.each do |name| | |
tasks = find_tasks_for_toplevel_task(name) | |
tasks.each do |t| |
NewerOlder