Skip to content

Instantly share code, notes, and snippets.


Justin Rainbow justinrainbow

  • Phoenix, AZ
View GitHub Profile
manugarri / nyc_tagger.ipynb
Created May 5, 2016
NYT ingredient tagger implementation with pyCRFSuite
View nyc_tagger.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jasonrdsouza /
Last active Sep 23, 2020
Python script to efficiently concatenate S3 files
This script performs efficient concatenation of files stored in S3. Given a
folder, output location, and optional suffix, all files with the given suffix
will be concatenated into one file stored in the output location.
Concatenation is performed within S3 when possible, falling back to local
operations when necessary.
Run `python -h` for more info.
Dr-Nikson /
Last active Mar 13, 2018
Auth example (react + redux + react-router)
progrium / sshmany
Last active Apr 20, 2016
bash script for executing a command via ssh in parallel on multiple servers with colored output
View sshmany
# Usage:
# $ echo "host1 host2 host3" | ./sshmany uname -a
# $ cat myservers | ./sshmany echo Hello world
for server in $servers; do
asm89 / gist:5797852
Last active Dec 18, 2015
Rerun PHPUnit on file changes in a given dir (defined in my .bashrc)
View gist:5797852
# watch files and rerun phpunit on changes
phpunitwait() {
while inotifywait $(find $1 -name '*.php');
phpunit --colors $2;
pborreli / YourCommand.php
Last active Aug 23, 2020
Show progress of a file download inside Symfony 2.3 console #howto
View YourCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
$progress = $this->getHelperSet()->get('progress');
$ctx = stream_context_create(array(), array('notification' => function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($output, $progress) {
switch ($notification_code) {
$progress->start($output, $bytes_max);
mrflip /
Last active Sep 28, 2020
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
    • measure before/after of client query time with and without warmers (MD)
callado4 /
Last active Apr 17, 2018
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

            base_url: http://dev.local
            goutte: ~
                wd_host: "http://localhost:8643/wd/hub" 
SlexAxton / .zshrc
Last active Sep 23, 2020
My gif workflow
View .zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
markjaquith / gist:4500280
Last active Sep 7, 2016
Bash command to fix a quirk with Sublime Text 2's "subl" command. Sometimes, when using it, under hard-to-pinpoint circumstances, it will open up Sublime Text 2 completely blank (i.e. the file you asked it to open will not be open). This snippet fixes that by essentially kicking subl under the table to wake it up and then passing on the command …
View gist:4500280
function subl() {
if [[ ! -p /dev/stdin ]]; then
command subl > /dev/null 2>&1
command subl "$@"
You can’t perform that action at this time.