Skip to content

Instantly share code, notes, and snippets.

@jzumbrun
jzumbrun / greetings.json
Last active September 7, 2025 23:06
API Test
[
{ "phrase": "Howdy y'all", "dialect": "southern" },
{ "phrase": "Ello govna", "dialect": "british" },
{ "phrase": "Sup", "dialect": "dude" }
]
@jzumbrun
jzumbrun / asink.js
Last active October 29, 2018 01:05
Async Generator Greeting
/**
* ASink
* Wraps a function around a generator to pass in its itorator
* This allow code within the generator to call its own next()
**/
module.exports = (wrap) => {
// Wrap allow us to pass in the object reference that holds
// the generator itorator
var gen = wrap(this)
@jzumbrun
jzumbrun / php7.sh
Created November 18, 2015 02:12
php7
sudo apt-get remove php5*
git clone https://github.com/kasparsd/php-7-debian.git
cd php-7-debian
./build.sh
./install.sh
sudo rm -Rf php-7-debian/
cd /usr/local/php7/bin
@jzumbrun
jzumbrun / gist:9707430
Created March 22, 2014 13:49
Add ssh key to server
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> ~/.ssh/authorized_keys'
@jzumbrun
jzumbrun / php
Last active January 2, 2016 06:19
PHP Fast CGI runner.sudo vim /etc/init.d/phpsudo chmod +x /etc/init.d/phpThen /etc/init.d/php start
#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=1
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0