Skip to content

Instantly share code, notes, and snippets.

@chrisallick
chrisallick / com.chrisallick.movenzbs
Created May 1, 2014 09:13
Move your NZBs from the Downloads folder to the sickbeard folder. Tell nzbget to rescan and start downloading.
<?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>Label</key>
<!-- The label should be the same as the filename without the extension -->
<string>com.chrisallick.movenzbs</string>
<!-- Specify how to run your program here -->
<key>ProgramArguments</key>
<array>
@chrisallick
chrisallick / gist:2e388fc13a3fa3e0b788
Created June 24, 2014 14:12
Installing and running Elliot Woods Kinect4Windows2 oF Addon
After some fiddling and asking a lot of questions I succesfully go the Kinect V2 running in the master branch of openFrameworks.
As a total newb to oF and visual studio this is the easiest solution I've come across.
To prepeare your computer make sure you have the following:
Windows 8.1 x64
A laptop with USB 3.0 (Im on a macbook pro retina 2013)
Visual Studio 2012 - http://www.microsoft.com/en-us/download/details.aspx?id=34673
ffmpeg -i video.mp4 -f image2 -vf fps=fps=0.1 img%d.png
files=$(ls img*.jpg | sort -t '-' -n -k 2 | tr '\n' ' ')
convert $files -append output.jpg
@chrisallick
chrisallick / https s
Created August 22, 2014 19:33
Self-signed certificate plain text response AFNetworking AFHTTPRequestOperationManager
-(void) testHTTPS {
AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init];
[securityPolicy setAllowInvalidCertificates:YES];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager setSecurityPolicy:securityPolicy];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
[manager GET:[NSString stringWithFormat:@"%@", HOST] parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *string = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
@chrisallick
chrisallick / gist:046579aef905f8993f04
Created August 28, 2014 14:29
average all your instagram photos
// download your instagram photos here
// http://instaport.me/
// create a data folder in your Sketch's folder
// paste all the images in there
// it takes a little while to run.
void setup() {
size( 612, 612 );
String path = sketchPath+"/data/";
@chrisallick
chrisallick / peekaboo.js
Created September 2, 2014 15:13
simple class for tracking scroll position of page and hiding or showing a div.
var peekaboo;
$(document).ready(function() {
peekaboo = new Peekaboo();
peekaboo.addElement( $("#backtotop"), false, 50 );
$("#backtotop").click(function(){
$('html,body').animate({
scrollTop: 0
}, 750);
@chrisallick
chrisallick / gist:12ec6bd61c2dfffda84b
Created September 9, 2014 19:24
Here is a list of thoughts while watching the Apple Event
New Tech/Potential
Barometric sensor - you can tell the difference in height with the phone
VoLTE/WiFi - voice calls as data, interactives without cell service
2x faster focus time - quick snapshot experiences
better panoramics - experiences where you pan along a very large photo
60fps at 1080, 240fps slo-mo
iHealth - basically you can replace any physical wearable with an app
touch id - for apps now
ApplePay - tap to pay with iPhone
NFC - tap to do anything, instant, and no pairing required, explore a wall by swiping your phone across it.
@chrisallick
chrisallick / map.js
Created September 24, 2014 20:19
map function for javascript like processing
function map ( value, in_min , in_max , out_min , out_max ) {
return ( value - in_min ) * ( out_max - out_min ) / ( in_max - in_min ) + out_min;
}
@chrisallick
chrisallick / IEVersion.js
Created October 7, 2014 16:22
function that returns IE version works with 9,10,11
/**
* returns IE Version
*/
function getInternetExplorerVersion() {
var rv = -1;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) {
rv = parseFloat( RegExp.$1 );
@chrisallick
chrisallick / auto-checkout-snippet.js
Created October 23, 2014 16:32
here is a snippet for auto-populating the supreme checkout page.
// // step 3) autopopulate the checkout register
if( window.location.href == "https://www.supremenewyork.com/checkout" ) {
console.log("step 3 - bingo");
setTimeout(function() {
$("#order_billing_name").val(options.fullname);
$("#order_email").val(options.email);
$("#order_tel").val(options.phone);
$("#order_billing_address").val(options.address);
$("#order_billing_zip").val(options.zip);
$("#order_billing_city").val(options.city);