Skip to content

Instantly share code, notes, and snippets.

Michael Harbach harbhub

Block or report user

Report or block harbhub

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:f2e145afc7d3f656651f5988b42c7a27
@IBOutlet var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = NSURL(string: "https://www.google.com/")
let requestObject = NSURLRequest(URL: url!)
webView.loadRequest(requestObject)
}
@harbhub
harbhub / getset.js
Last active Aug 29, 2015 — forked from bberry6/getset.js
get an object from redis, modify contents, and set
View getset.js
var Bluebird = require('bluebird');
var redis = require('redis');
var _ = require('lodash');
function getSet(key, transmute){
return new Bluebird(function(resolve, reject){
function setAtomic(key, count){
var counts = count;
// create a UNIQUE CLIENT CONNECTION for this process
View gist:6868490
ASPX
<div>Testing <%= myString %> Testing</div>
C#
using...;
public partial class TelerikWebForm : System.Web.UI.Page
{
public string myString = "Success";
}
View gist:6686897
//Step One: I already have this string, which I retrieved from the SQL database
string listOfRecipients = "abc@some.com,john@doe.net";
//Step Two
Array arrayOfRecipients = listOfRecipients.Split(",");
//Step Three
int i = 0;
//Somehow I need to get this:
/*
View gist:5889576
process.env.harbachi = {};
console.log(JSON.stringify(process.env.harbachi));//"[object Object]"
process.stdout.write(JSON.stringify(process.env.harbachi));//"[object Object]"
View gist:5888957
var exec = require('child_process').exec,
child;
child = exec('ls',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
View gist:5733983
//server.js
var speech = require('google-speech-api');
speech({'file': '/test.wav'}, function (err, results) {
if (err) throw err;
console.log(results);
// [{status: 0, id: '...', hypotheses: [{utterance: 'this is a test', confidence: 0.9162679}]}]}]
});
//test.wav
View gist:4954698
C:\Users\mike>cd harb
C:\Users\mike\harb>jitsu deploy
info: Welcome to Nodejitsu harbhub
info: jitsu v0.11.7, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in servant.js
WARN package.json harbhub@0.0.0-25 No README.md file found!
info: Creating snapshot 0.0.0-25
View gist:4949091
Support for name-based virtual servers
From the application protocol point of view, TLS belongs to a lower layer, although the TCP/IP model is too coarse to show it. This means that the TLS handshake is usually (except in the STARTTLS case) performed before the application protocol can start. The name-based virtual server feature being provided by the application layer, all co-hosted virtual servers share the same certificate because the server has to select and send a certificate immediately after the ClientHello message. This is a big problem in hosting environments because it means either sharing the same certificate among all customers or using a different IP address for each of them.
There are two known workarounds provided by X.509:
If all virtual servers belong to the same domain, a wildcard certificate can be used. Besides the loose host name selection that might be a problem or not, there is no common agreement about how to match wildcard certificates. Different rules are applied depending on the ap
View gist:4772225
var form = new formidable.IncomingForm();
var fields = [];
var files = [];
form.uploadDir = __dirname+'/tmp';
form
.on('field', function(field, value) {
log(field,value);
})
You can’t perform that action at this time.