Skip to content

Instantly share code, notes, and snippets.

@tyhenry
tyhenry / get_local_ips.cpp
Created May 12, 2019 05:52
grab local machine ip addresses (oF)
vector<string> ofApp::getLocalIPs()
{
vector<string> result;
#ifdef TARGET_WIN32
string commandResult = ofSystem("ipconfig");
//ofLogVerbose() << commandResult;
for (int pos = 0; pos >= 0; )
@tyhenry
tyhenry / ffmpeg-batch.sh
Created May 6, 2019 15:12
batch convert video with ffmpeg
for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done
@tyhenry
tyhenry / install git-completion.bash
Last active April 17, 2019 19:07
git completion
# git bash autocompletion (for branch names, etc.)
#
# https://apple.stackexchange.com/a/243276/199115
#
# installation instructions:
#
# 1.
# run command:
--style=kr --indent=tab=4 --min-conditional-indent=0 --max-instatement-indent=80 --indent-switches --indent-cases --indent-namespaces --indent-preproc-block --indent-preproc-define --indent-col1-comments --break-blocks=all --pad-oper --pad-paren-in --unpad-paren --add-one-line-brackets --mode=c
@tyhenry
tyhenry / notify.py
Created January 28, 2019 04:32
send gmail notifications from cmd line
#!/usr/bin/env python3
"""
Quickly send email from the command line with gmail.
https://bbengfort.github.io/snippets/2017/04/17/gmail-notifications-python.html
use:
notify.py -r jdoe@example.com -s "computation complete" results.csv
"""
@tyhenry
tyhenry / .hyper.js
Created January 22, 2019 22:15
hyper terminal settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@tyhenry
tyhenry / arduino_knock_sensor.ino
Last active January 7, 2019 01:01
piezo knock sensor code
/* A simple sketch to detect a secret knock using a piezo transducer
copied from
https://programmingelectronics.com/how-to-make-a-secret-knock-detector-to-trigger-anything-with-only-an-arduino-and-a-few-cheap-components/
to be combined with solenoid control circuit
https://core-electronics.com.au/tutorials/solenoid-control-with-arduino.html
Created JUL 2015 by
Michael James
@tyhenry
tyhenry / ls_color
Created December 18, 2018 15:07
ls with color
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
@tyhenry
tyhenry / cd && ls
Created December 18, 2018 15:05
cdl shell
cdl() {
cd "$@" && ls;
}
@tyhenry
tyhenry / cherrypicker.itermcolors
Created November 30, 2018 16:22
CherryPicker - iTerm2 color scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.021151773631572723</real>