Skip to content

Instantly share code, notes, and snippets.

View hengkiardo's full-sized avatar

Hengki Sihombing hengkiardo

  • Jakarta, Indonesia
View GitHub Profile
@roolo
roolo / .gitconfig
Created October 21, 2011 14:39
git-merge with KDiff3 on Mac OS X Lion
# This is file ~/.gitconfig
[merge]
tool = extMerge
[mergetool "extMerge"]
cmd = ~/bin/extMerge \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
(function($){
function dragEnter(e) {
$(e.target).addClass("dragOver");
e.stopPropagation();
e.preventDefault();
return false;
};
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
@mcollina
mcollina / 1-NetworkButtonJSON.md
Last active December 15, 2015 23:00
NetworkButtonJSON

NetworkButtonJSON

NetworkButtonJSON is a forest of network enabled leds that switch on and off on simultaneosly. Join the forest, build a networked LED.

You should:

  • mount an Arduino Ethernet Shield.
  • build an Arduino-based prototype with the following schema:
@makotot
makotot / Gruntfile.js
Last active December 19, 2015 13:49
grunt-contrib-watchでlivereload
module.exports = function (grunt) {
'use strict';
// grunt-contrib-watchのlivereloadオプションでlivereload
grunt.initConfig({
watch: {
html: {
files: '**/*.html',
tasks: [],
@ryanhanwu
ryanhanwu / proxy.js
Created July 18, 2013 17:59
Node.js HTTP hostname redirect and proxy normal HTTP+WebSockets traffic
var http = require('http'),
_ = require('underscore'),
httpProxy = require('http-proxy');
var proxyOptions = {
router: {
"api.testAppX.com" : 'localhost:2041',
"dev.api.testAppX.com" : 'localhost:2042',
"www.testAppY.com" : 'localhost:10520',
"test.oldApps.com" : 'localhost:10520',
'bc.ryanwu.co' : 'localhost:8888'
@roolo
roolo / gist:8538765
Last active January 3, 2016 23:59
Reset author in git
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Mailo Světel'
GIT_AUTHOR_EMAIL='development@rooland.cz'
GIT_COMMITTER_NAME='Mailo Světel'
GIT_COMMITTER_EMAIL='development@rooland.cz'
" HEAD
var app = angular.module('validationExample', []);
app.controller('signupController', ['$scope', function($scope) {
$scope.submitted = false;
$scope.signupForm = function() {
if ($scope.signup_form.$valid) {
} else {
$scope.signup_form.submitted = true;
}
@turtlesoupy
turtlesoupy / child_monitor.coffee
Created June 25, 2012 01:12
A node.js process supervisor and a sample use with health checks - see http://blog.argteam.com/coding/hardening-nodejs-production-process-supervisor/
{_} = require 'underscore'
child_process = require 'child_process'
async = require 'async'
healthCheckInterval = 60 * 1000
bounceInterval = 60 * 1000
bounceWait = bounceInterval + 30 * 1000
delayTimeout = (ms, func) -> setTimeout func, ms
class MonitoredChild
@apanimesh061
apanimesh061 / a_mongo-connector_tutorial.md
Last active May 26, 2018 11:40
mongo-connector with ES 2.2.0 and Mongo 2.6

Before starting please have a mongo replica set initiated. I have mongo running at localhost:27170 and elasticsearch at localhost:9200

The test dataset I used is available on the mongodb website.

I am using MongoDB 2.6 and Elasticsearch 2.2.0 on a Windows machine.

Here I have tested three cases:

  • An index already exists, mc-test-index in this case
@TooTallNate
TooTallNate / mp3player.js
Created October 24, 2012 17:42
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});