Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Rainbow justinrainbow

  • Phoenix, AZ
View GitHub Profile
@manugarri
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
jasonrdsouza / combineS3Files.py
Last active Sep 23, 2020
Python script to efficiently concatenate S3 files
View combineS3Files.py
'''
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 combineS3Files.py -h` for more info.
'''
@Dr-Nikson
Dr-Nikson / README.md
Last active Mar 13, 2018
Auth example (react + redux + react-router)
View README.md
@progrium
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
#!/bin/bash
#
# Usage:
# $ echo "host1 host2 host3" | ./sshmany uname -a
# $ cat myservers | ./sshmany echo Hello world
#
cmd="$@"
servers="$(cat)"
i=37
for server in $servers; do
@asm89
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');
do
clear;
phpunit --colors $2;
done;
}
@pborreli
pborreli / YourCommand.php
Last active Aug 23, 2020
Show progress of a file download inside Symfony 2.3 console #howto
View YourCommand.php
<?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) {
case STREAM_NOTIFY_FILE_SIZE_IS:
$progress->start($output, $bytes_max);
break;
@mrflip
mrflip / 20130416-todo.md
Last active Sep 28, 2020
Elasticsearch Tuning Plan
View 20130416-todo.md

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
callado4 / behat-phantomjs-webdriver.md
Last active Apr 17, 2018
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests
View behat-phantomjs-webdriver.md

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

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
                wd_host: "http://localhost:8643/wd/hub" 
@SlexAxton
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
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@markjaquith
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
fi
command subl "$@"
}
You can’t perform that action at this time.