Skip to content

Instantly share code, notes, and snippets.

View ZacharyJacobCollins's full-sized avatar
☁️
head in the clouds

Zac Collins ZacharyJacobCollins

☁️
head in the clouds
View GitHub Profile
@ZacharyJacobCollins
ZacharyJacobCollins / observable-from-stream.js
Created December 29, 2016 22:07
ES7 Observables + WHATWG Streams
// ES7 Observables + WHATWG Streams
//
// https://github.com/jhusain/asyncgenerator
// https://github.com/whatwg/streams
//
// Continuation from file:
// https://github.com/jhusain/asyncgenerator/blob/master/src/observable.js
Observable.fromStream = function(readable) {
return new Observable(function(generator) {
@ZacharyJacobCollins
ZacharyJacobCollins / ngrok yml
Last active April 19, 2021 12:39
Ngrok yml
lives in ~/.ngrok2/ngrok.yml
authtoken: (authtokenhere)
tunnels:
trove-assistant-zcollins:
addr: api-assistant.lift.dev:80
proto: http
host_header: rewrite
bind_tls: true
subdomain: trove-assistant-zcollins
@ZacharyJacobCollins
ZacharyJacobCollins / grep
Created May 8, 2017 18:19
Grep commands
grep -i "whatever" ./*
searches for thing in current directory
Update clock synch
sudo ntpdate pool.ntp.org
Install ntp daemon
sudo apt-get install ntp
@ZacharyJacobCollins
ZacharyJacobCollins / ping trace.py
Last active May 23, 2017 06:44
python_ping_trace
# create websites.txt, place in same directory as script. Fill with list of splitlines
# create empty file results.txt
# run python ping.py
import urllib2
import subprocess
def readFile():
array = []
with open('./websites.txt') as file:
@ZacharyJacobCollins
ZacharyJacobCollins / sh
Created June 4, 2017 02:59
Install open cv ubuntu
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev
fswatch [opts] -0 <file/dir here> ... | xargs -0 -n1 -I{} echo hi
phrases = ['clean message', 'what is new'];
function test_phrase(phrase) {
var input = document.getElementById('edw-test-utteranceTextField');
input.value = phrase;
}
test_phrase(phrases[1]);
* Sets up specific DI container configuration
*
* @param AuthSession $auth_session
*/
protected function setup_container(AuthSession $auth_session)
{
$this->container->set('provider', Inflector::camelize($auth_session->get_provider()->get_name()));
$this->container->set('provider.attributes', Inflector::camelize($auth_session->get_implementation()->get_name()));
foreach ($this->config->get_container() as $class => $definition)
@ZacharyJacobCollins
ZacharyJacobCollins / foo.log
Created June 24, 2018 03:39 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred