Skip to content

Instantly share code, notes, and snippets.

@sunnygleason
sunnygleason / hello.rb
Created January 12, 2012 16:12
hello world
puts :hello_world
puts "hello world"
@sunnygleason
sunnygleason / sysctl.conf
Created April 26, 2012 22:50
fix local tcp connection exhaustion on linux
net.ipv4.ip_local_port_range = 15000 61000
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
@sunnygleason
sunnygleason / dual_http_servers.js
Created June 7, 2012 13:23
node.js http servers suitable for debugging
var http = require('http');
http.createServer(function (req, res) {
console.log(req);
var body = '';
req.on('data', function (data) { body += data; });
req.on('end', function () {
console.log('body', body);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('service the first\n');
package io.tesla.issues.jira;
import java.nio.charset.Charset;
import com.google.common.io.BaseEncoding;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
public class JiraService {

Keybase proof

I hereby claim:

  • I am sunnygleason on github.
  • I am sunnygleason (https://keybase.io/sunnygleason) on keybase.
  • I have a public key whose fingerprint is 94F9 8995 A7DE 8C1A 2E40 6079 D84A F7B7 14E3 1BF6

To claim this, I am signing this object:

var CHANNEL, CHUNK_SIZE, CLIENT_NAME, H_RES, PHOTO_INTERVAL, V_RES, child, fs, imageCallback, pn, pnCfg;
fs = require('fs'); // included with nodejs
child = require('child_process'); // included with nodejs
CLIENT_NAME = 'dashcam-001';
CHANNEL = 'dashcam-demo';
CHUNK_SIZE = 1024 * 28;
PHOTO_INTERVAL = 10000;
H_RES = (400).toString();
<!doctype html>
<html>
<head>
<script src="https://cdn.pubnub.com/pubnub-3.15.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://cdn.pubnub.com/sdk/pubnub-angular/pubnub-angular-3.2.1.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
</head>
<body>
<div class="container" ng-app="PubNubAngularApp" ng-controller="DashCamCtrl">
@sunnygleason
sunnygleason / garage.js
Created August 28, 2016 22:59
Liftmaster Garage Control Integration w/ PubNub and Node.JS
var CTRL_CHAN, DOOR_STATES, HOME_CHAN, LIFTMASTER_PASSWORD, LIFTMASTER_USERNAME,
MyQ, PUB_KEY, PubNub, SUB_KEY, garage, initPubNub, makeHandler, pubnubConns,
refreshStatus, _;
_ = require('underscore');
MyQ = require('liftmaster');
PubNub = require('pubnub');
LIFTMASTER_USERNAME = 'YOUR_LIFTMASTER_USERNAME';
LIFTMASTER_PASSWORD = 'YOUR_LIFTMASTER_PASSWORD';
@sunnygleason
sunnygleason / garage_ui.html
Created August 28, 2016 23:03
LiftMaster Garage Control UI w/ PubNub and AngularJS
<!doctype html>
<html>
<head>
<script src="https://cdn.pubnub.com/pubnub-3.15.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://cdn.pubnub.com/sdk/pubnub-angular/pubnub-angular-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
</head>
@sunnygleason
sunnygleason / demo_tts.html
Last active September 28, 2016 08:31
AngularJS Text To Speech
<!doctype html>
<html>
<head>
<script src="https://cdn.pubnub.com/pubnub-3.15.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://cdn.pubnub.com/sdk/pubnub-angular/pubnub-angular-3.2.1.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
</head>
<body>