Skip to content

Instantly share code, notes, and snippets.

@habahut
habahut / Ether Request
Created October 12, 2017 12:33
Ether Request for Trevor Haba
1e87ba20e81df142b2f93e0e6c5992d677572fec
@habahut
habahut / gist:477586ffe6da9f0960fb
Created January 6, 2015 01:15
Xdebug With Vim Installation
Install vim: must have +python and +signs
install: http://www.vim.org/scripts/script.php?script_id=2508
run these commands:
sudo apt-get install php5-dev php-pear
sudo pecl install xdebug
grab location of xdebug.so from installation output, put here: /etc/php5/apache2/php.ini
zend_extension=`/path/to/xdebug.so`
nnoremap <leader>D :DiffSaved<cr>
function! s:DiffWithSaved()
let filetype=&ft
diffthis
vnew | r # | normal! 1Gdd
diffthis
exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype
endfunction
com! DiffSaved call s:DiffWithSaved()
@habahut
habahut / gist:f0a3472638d5833a50b3
Last active August 29, 2015 14:02
Windows 8 PHP *.so Fix
It is likely that you will need to update your copy of php running on the devbox. To do this,
you will need to navigate to the manual link to download the newest version of PHP in the
placelocal repo. Browsing to the download link, and copy and paste it like so:
`cd /vagrant`
`wget <insert download link here>`
This will download the version to a file in the current folder. Type `ls` to find it, then:
`tar -xzf <the file name>`
@habahut
habahut / gist:bffde323e140fd6d5bdb
Last active August 29, 2015 14:02
Ack-grep tool for vim, put in .vimrc
:GrepTab <search term> <path> will open a new tab and show you all results from ack-grep of the search term on the path given. No path will default to current directory
(I recommend you ad `set autochdir` to your .vimrc as well, so that the "present working directory" is always at the file your editing. It makes searching for stuff easier)
nnoremap <leader>f :GrepTab "example binding
function! s:NewTabGrep(...)
let args=split(a:1)
if len(args) == 2
let dir=args[1]
else
@habahut
habahut / gist:06a79a201c4c91a58ab4
Created May 9, 2014 01:11
data viz beginnings
My understanding so far:
one object per topic: for example TPS could be called the TPSTracker
Each object will have many little processes it is forwarding data to, so for example in TPS there would be a little process for "# of jobs started", "# of jobs on each TPS server" etc...
the TPSTracker will forward each kafka message it recevies to each of hte little entities, which will maintain their own state on the aggregate totals for their piece, throwing away the rest. So the TPS load piece would receive the entire TPS message from kafka, and only update the state for the load on the TPS servers, ignoring everything else.
Then, we stringify the state of each individual peice and send that to the client, and allow them to put that data into the charts on the clients page.
btw Kyle your idea of not bothering to verify producer output makes a lot more sense when we look at it this way, though I still think we should enforce some regularity :)