Skip to content

Instantly share code, notes, and snippets.

View realguess's full-sized avatar

Chao Huang realguess

View GitHub Profile
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@realguess
realguess / jasmine-setup-teardown.js
Created June 10, 2014 02:42
Understand Jasmine testing framework setup and teardown by examples.
// Setup and Teardown
// ==================
//
// Jasmine [Setup and Teardown] examples.
//
// [Setup and Teardown]: http://jasmine.github.io/2.0/introduction.html#section-Setup_and_Teardown
// Specific to Firefox only.
function watchHandler(prop, oldVal, newVal) {
console.log(prop + ' changed from ' + oldVal + ' to ' + newVal);
@realguess
realguess / amazon-sns-server.js
Created March 21, 2014 04:50
A simple Amazon SNS HTTP endpoint server that subscribe to a topic and show request and response logs related to Amazon SNS activities.
// Amazon SNS HTTP Endpoint
// ========================
//
// A simple Amazon SNS HTTP endpoint server that subscribe to a topic and show
// request and response logs related to Amazon SNS activities.
//
// > (c) 2014 Chao Huang <chao@realguess.net>
var http = require('http');
var https = require('https'); // HTTPS is needed for Amazon SNS subscription.