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
attr_accessor :filename
attr_accessor :neighbours
function switch_branch() {
for branch in master f/fast_find
git -C ~/.vendor/detect_virtualenv checkout $branch >/dev/null 2>&1
. ~/.vendor/detect_virtualenv/detect_virtualenv 2>/dev/null
$@ $branch
dgholz /
Created Feb 20, 2017
FizzBuzz (Befunge93)
v _@>v >v>:#<.>1+:2^
>:3%|>:5%|> 1#^_^
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
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
set background=dark
colorscheme solarized
let g:ctrlp_map = '<c-p>'
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
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}"
def hi_bleak
puts "hi bleak you are #{Bleak}"
You can’t perform that action at this time.