Skip to content

Instantly share code, notes, and snippets.


Hengki Sihombing hengkiardo

  • Jakarta, Indonesia
View GitHub Profile
hengkiardo / redis.markdown
Created Sep 24, 2015 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu
View redis.markdown

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
View gist:a8e5b61fb7f4594faa01
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
main (int argc, char * argv[])
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();
# chkconfig: 35 99 99
# description: Node.js app server script
. /etc/rc.d/init.d/functions

RethinkDB Setup on OSX

This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.

First Installation

Install Homebrew if you don't already have it:

View cors-nginx.conf
# Wide-open CORS config for nginx
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
View route.js'/login', function(req, res) {
passport.authenticate('local', function(err, user, params) {
if (req.xhr) {
//thanks @jkevinburton
if (err) { return res.json({ error: err.message }); }
// e.g. in auth.js:
// if (!user.emailVerified) { return done(null, false, { message: 'Email is not verified. Please check your email for the link.' }); }
if (!user && params) { return res.json({error : params.error}); }
View gist:c521f636e9edd7e1a98e
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
Windows Surface Pro*/
@media only screen and (max-width: 800px) and (orientation : portrait) {
Acer Iconia Tab A100
View async-process-jasmine.Spec.js
AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
it('should process 42', function() {
You can’t perform that action at this time.