Skip to content

Instantly share code, notes, and snippets.

View mattneary's full-sized avatar

Matt Neary mattneary

View GitHub Profile
@mattneary
mattneary / index.js
Last active December 15, 2015 03:09
ec2 server file
var net = require('net');
var httpProxy = require('http-proxy');
var sites = [{
domain: "bwhs.me",
path: __dirname + "/sites/Watterson-Dresses/server.js",
port: 3001
}];
var options = {
@mattneary
mattneary / hook.js
Created March 19, 2013 18:37
Github Service Hook
var http = require('http');
var exec = require('child_process').exec;
var repo = "https://github.com/mattneary/Watterson-Dresses.git";
http.createServer(function(req, res) {
exec("rm -rf /home/ec2-user/sites/Watterson-Dresses", function(err, stdout, stderr) {
if( err ) {
res.writeHead(400);
res.end("error: "+JSON.stringify(err))
return;
@mattneary
mattneary / fetch.js
Created May 30, 2013 00:21
Band Video Fetcher
var http = require('http'),
fs = require('fs');
var req = http.request({
mathod: 'GET',
host: 'brightcove03-f.akamaihd.net',
path: '/2012rebroadcastHD_dci_live@55848?videoId=2407134469001&lineUpId=&pubId=27638699&playerId=1684416337001&affiliateId=&v=2.11.3&fp=MAC%2011,7,700,203&r=SLZWK&g=RYSHXMKECKNV&seek=251.097',
port: '80'
}, function(resp) {
resp.pipe(fs.createWriteStream(__dirname + '/movie.flv'));
#pragma config(Motor, motorA, leftMotor, tmotorNXT, PIDControl, encoder)
#pragma config(Motor, motorB, rightMotor, tmotorNXT, PIDControl, encoder)
#pragma config(Sensor, S4, colorSensor, sensorCOLORFULL)
#include "Simple Car Header.c"
/*
___________________________________
| |
| /========================\ |
| | AUTOMATED PERIOD DIAGRAM | |
@mattneary
mattneary / app.coffee
Created June 9, 2013 01:48
Recursive Functions of Symbolic Expressions
# Elementary List Functions
cons = (a, b) -> (option) -> switch option
when true then a
else b
nil = null
atom = (x) -> typeof(x) != 'function'
car = (x) -> x(true)
cdr = (x) -> x(false)
# Functions on Recursive Pairs
@mattneary
mattneary / eagle-control.c
Last active December 18, 2015 10:09
Robotics Institute Team Code
#pragma config(Motor, motorA, leftMotor, tmotorNXT, PIDControl, encoder) //
#pragma config(Motor, motorB, rightMotor, tmotorNXT, PIDControl, encoder) //
#pragma config(Sensor, S1, touchSensor, sensorTouch) //
//
#include "./Headers/JoystickDriver.c" //
// Do Not Add Or
float speed = 1.0; // Modify Code Above
#include "./Headers/Control Header.c" //
//
#define THRESHOLD 0 //
@mattneary
mattneary / resume.md
Last active December 19, 2015 15:59
My Résumé
@mattneary
mattneary / adder.html
Created July 20, 2013 18:51
SO Adder
<script>
var inputs = {};
function save(value, name) {
inputs[name] = parseInt(value);
}
function checker(criterion, action) {
return function(value, name) {
if( !criterion(value) ) {
alert("Not Numeric");
} else {
@mattneary
mattneary / index.js
Created September 23, 2013 19:50
Fix fix
// lemonad source...
L.fix1 = L.curry(L.curry)(1);
L.fix2 = L.curry(L.curry)(2);
L.fix3 = L.curry(L.curry)(3);
L.fix4 = L.curry(L.curry)(4);
// function we could provide:
L.fix = L.curry(L.curry);
@mattneary
mattneary / examples.php
Last active December 28, 2015 10:29
Shitty PHP
<?
/*
PHP takes the design of Perl (ugly), the interfaces
of C (low-level and clunky), and the OO of C++
(an impure mess). Some things are completely broken,
and every API is either inconsistent or just
inconvenient.
Its only utility is its output of inline text, which