Skip to content

Instantly share code, notes, and snippets.

View HarrisonJackson's full-sized avatar

Harrison Jackson HarrisonJackson

View GitHub Profile
@HarrisonJackson
HarrisonJackson / iPhone OSC Arduino Demo
Created December 1, 2012 20:48
iPhone OSC Arduino Demo
import cc.arduino.*;
import processing.serial.*;
import oscP5.*;
import netP5.*;
Arduino arduino;
OscP5 oscP5;
float redAmount = 0.0f;
@HarrisonJackson
HarrisonJackson / gist:4485245
Created January 8, 2013 16:32
No Cache Headers
Cache-Control: no-cache, max-age=0, must-revalidate, no-store
@HarrisonJackson
HarrisonJackson / gist:4653211
Last active December 11, 2015 20:09
Pass by reference vs value examples
void addTwo (int a){
a = a+2;
}
void duplicate (int a, int& b, int& c){
addTwo(a);
c = b;
cout << a;
}
@HarrisonJackson
HarrisonJackson / gist:4747987
Created February 10, 2013 02:02
Jquery 1.8+ ajax submit - with new callbacks
// variable to hold request
var request;
// bind to the submit event of our form
$("#myform").submit(function(event){
// abort any pending request
if (request) {
request.abort();
}
// setup some local variables
var $form = $(this);
@HarrisonJackson
HarrisonJackson / gist:5110773
Created March 7, 2013 19:03
Share the current directory over http at localhost:8080
python -m SimpleHTTPServer 8080
@HarrisonJackson
HarrisonJackson / gist:5232962
Created March 24, 2013 18:31
Get command line args
#include <iostream>
#include <string>
#include "package.cpp"
#include "labeler.cpp"
using namespace std;
// $ g++ main.cpp -o main
// $ ./main arg2 arg3 otherarg4
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5000.mp4 --encoder x264 -b 5000 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 500.mp4 --encoder x264 -b 500 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 50.mp4 --encoder x264 -b 50 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5.mp4 --encoder x264 -b 5 --srt-file TOS-en.srt --x264-preset ultrafast
mkdir 5000Kbps
mediafilesegmenter -t 10 -f 5000Kbps/ -I 5000.mp4
mkdir 500Kbps
mediafilesegmenter -t 10 -f 500Kbps/ -I 500.mp4
mkdir 50Kbps
@HarrisonJackson
HarrisonJackson / .eslintrc
Last active August 29, 2015 14:26 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@HarrisonJackson
HarrisonJackson / Common Zapier Code Snippets.md
Last active August 29, 2015 14:27
Common Zapier Code snippets

To use any of these snippets:

1. Set the input for the Code app trigger to pass any field you want to modify as "content":

input

2. Paste the snippet into the Code app input field:

code editor