Skip to content

Instantly share code, notes, and snippets.

View greentornado's full-sized avatar

Hai Nguyen greentornado

View GitHub Profile
@greentornado
greentornado / Readme.md
Created November 9, 2015 05:23 — forked from ChuckJHardy/Readme.md
ZeroMQ + Node.js + Socket.io + UI for sending message from Ruby to a Javascript UI running on Node.js

Install the following requirements:

brew info zeromq
npm install zmq
npm install socket.io
gem install ffi-rzmq

Within the app directory run the following commands in different panes.

ruby worker.rb

@greentornado
greentornado / sbt-benchmark.sh
Created January 3, 2016 16:05 — forked from patriknw/sbt-benchmark.sh
Example of sbt launch script for akka benchmarks
#!/bin/sh
# Run the benchmark with this as sbt start script,
# but change the paths (/home/nordwall)
# ~/bin/sbt-benchmark.sh
# > project akka-actor-tests
# > test-only akka.performance.microbench.TellThroughputPerformanceSpec
export JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
export FLAGS="-server -Dfile.encoding=UTF8 -XX:+UseNUMA -XX:+UseCondCardMark -XX:-UseBiasedLocking"
@greentornado
greentornado / nginxproxy.md
Created January 31, 2016 09:11 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

def tail(f, n, offset=None):
"""Reads a n lines from f with an offset of offset lines. The return
value is a tuple in the form ``(lines, has_more)`` where `has_more` is
an indicator that is `True` if there are more lines in the file.
"""
avg_line_length = 74
to_read = n + (offset or 0)
while 1:
try:
@greentornado
greentornado / Flask-blueprint-with-imported-routes
Created March 17, 2016 05:10 — forked from Jaza/Flask-blueprint-with-imported-routes
Example of how to split a Flask blueprint into multiple files, with routes in each file, and of how to register all those routes.
*
@greentornado
greentornado / atom_clojure_setup.md
Created July 11, 2016 15:45 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@greentornado
greentornado / setup-rabbitmq-cluster.sh
Created July 17, 2016 16:10 — forked from adilbaig/setup-rabbitmq-cluster.sh
A complete bash script to setup a RabbitMQ cluster from scratch. Takes user-defined servers at run time.
#!/bin/bash
set -e
# This script is part of my blog post :
# http://thoughtsimproved.wordpress.com/2015/01/03/tech-recipe-setup-a-rabbitmq-cluster-on-ubuntu/
# It sets up a RabbitMQ cluster by connecting to user-provided master and slave servers
# and ringing them up to a cluster on the fly.
# RabbitMQ Clustering is described in detail here :
🚀 crystal src/main.cr -- examples/sqlite3.cr
/usr/include/sqlite3.h:35:10: fatal error: 'stdarg.h' file not found
@[Link("sqlite3")]
lib LibSQLite3
type Sqlite3 = Void*
fun open = sqlite3_open(filename : LibC::Char*, pp_db : Sqlite3*) : LibC::Int
fun open = sqlite3_open_v2(filename : LibC::Char*, pp_db : Sqlite3*, flags : LibC::Int, z_vfs : LibC::Char*) : LibC::Int
fun errcode = sqlite3_errcode(db : Sqlite3) : LibC::Int
fun errmsg = sqlite3_errmsg(x0 : Sqlite3) : LibC::Char*
type Sqlite3Stmt = Void*
abby.ns.cloudflare.com
ben.ns.cloudflare.com
@greentornado
greentornado / Sublime Text 3 Build 3103 License Key - CRACK
Created February 19, 2017 16:03
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04