Skip to content

Instantly share code, notes, and snippets.

View Mparaiso's full-sized avatar

mparaiso Mparaiso

View GitHub Profile
@Mparaiso
Mparaiso / jsonparse.js
Created February 24, 2017 17:05 — forked from creationix/jsonparse.js
event-only version of jsonparse
// Named constants with unique integer values
var C = {};
// Tokenizer States
var START = C.START = 0x11;
var TRUE1 = C.TRUE1 = 0x21;
var TRUE2 = C.TRUE2 = 0x22;
var TRUE3 = C.TRUE3 = 0x23;
var FALSE1 = C.FALSE1 = 0x31;
var FALSE2 = C.FALSE2 = 0x32;
var FALSE3 = C.FALSE3 = 0x33;
@Mparaiso
Mparaiso / gist:5055440
Last active May 15, 2020 15:20 — forked from pedro/gist:1288447
Sample PHP+Mongo app on Heroku

Sample PHP+Mongo app on Heroku

  1. Install any of the Mongo add-ons available at http://addons.heroku.com

  2. Vendor the Mongo driver with your application. You can download it here:

    https://github.com/wuputah/heroku-libraries/raw/master/php/mongo/mongo.so
    

    Add it to a folder like "ext".

Backend Architectures

ARCHITECTURES

ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats

@Mparaiso
Mparaiso / .tmux.conf
Created April 15, 2017 12:34 — forked from paulodeleo/.tmux.conf
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@Mparaiso
Mparaiso / postsql.sql
Created April 12, 2017 17:26 — forked from tobyhede/postsql.sql
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@Mparaiso
Mparaiso / latency.txt
Created April 4, 2017 16:54 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@Mparaiso
Mparaiso / scopes.txt
Created April 8, 2016 12:15 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@Mparaiso
Mparaiso / .jshintrc
Created November 23, 2013 05:43 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@Mparaiso
Mparaiso / README.md
Created October 12, 2013 12:19 — forked from nikcub/README.md