Skip to content

Instantly share code, notes, and snippets.

Daniel George Holz dgholz

Block or report user

Report or block dgholz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tiles.rb
class TileWithNeighbours
@@instances = []
attr_accessor :instances
def initialize(filename, **neighbours)
@filename = filename
@neighbours = neighbours
@@instances << self
end
attr_accessor :filename
attr_accessor :neighbours
View perlf_test.sh
#!/bin/bash
function switch_branch() {
for branch in master f/fast_find
do
git -C ~/.vendor/detect_virtualenv checkout $branch >/dev/null 2>&1
. ~/.vendor/detect_virtualenv/detect_virtualenv 2>/dev/null
$@ $branch
done
}
@dgholz
dgholz / fizzbuzz.bf
Created Feb 20, 2017
FizzBuzz (Befunge93)
View fizzbuzz.bf
1:v!`*5*54p2*62*77,*5<
v _@>v >v>:#<.>1+:2^
>:3%|>:5%|> 1#^_^
v"z"<pvv<"p
:>v>v2,"-z2
"",8**,B5"*
iF,622#"::4
"",,3*^<^<3
>^>^>^>,8#^6#*<
@dgholz
dgholz / .vimrc
Last active Feb 16, 2017
for each in ~/.vim/bundle/*/.git; do git -C $( dirname $each ) remote get-url origin; done | sort -k2 -t /
View .vimrc
" git@github.com:tpope/vim-pathogen.git
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
" git@github.com:altercation/vim-colors-solarized.git
set background=dark
colorscheme solarized
" git@github.com:ctrlpvim/ctrlp.vim.git
let g:ctrlp_map = '<c-p>'
@dgholz
dgholz / update-dns-with-dhcp-lease.rsc
Last active Nov 24, 2016
RouterOS script to create/delete DNS entries to match DHCP leases. Set it as your lease-script on your DHCP server.
View update-dns-with-dhcp-lease.rsc
/ip dhcp-server network
:local domain "default"
:do { :set domain [ get [ find where $leaseActIP in address ] domain ] } on-error={}
/ip dhcp-server
:local ttl [ get [ find where name=$leaseServerName ] lease-time ]
/ip dhcp-server lease
:local name
:do { :set name "$[ get [ find where server=$leaseServerName && address=$leaseActIP && mac-address=$leaseActMAC ] host-name ].$domain" } on-error={}
View gist:8313960
def prompt(text=[])
text = [text].flatten
text.unshift('>').push(nil) # for trailing space
print text.join(' ')
return gets
end
def counter(maxcount)
numbers = []
for i in maxcount
View gist:8145200
blake = "some guy"
Bleak = "a cool dude"
def hi_blake
puts "hi blake you are #{blake}"
end
def hi_bleak
puts "hi bleak you are #{Bleak}"
end
You can’t perform that action at this time.