Skip to content

Instantly share code, notes, and snippets.

@rektide
rektide / gist:6071546
Created July 24, 2013 15:20
renditions of with
// form the first
with (foo){
bar= 27
}
// alike form the second
eval("bar= 27", foo)
// alike form the third
vm.runInNewContext("bar= 27", foo)
@rektide
rektide / mongrel2.zeromq.md
Last active December 20, 2015 04:29
ZeroMQ for Use in Clustered HTTP serving

The concept of a clustered IP is just that there is a public IP which connects to multiple backend systems. Many front-end firewall boxes perform such a duty of standing at the front of that IP and forwarding incoming connections to application servers, also often offering services such as sticky sessions that help incoming HTTP traffic to continually make it to the same box. Apache itself, Nginx, HAProxy, all these are often used as forwarding agents, a front end recieving traffic on a bound address and forwarding it to destination application services.

Mongrel2 is another such HTTP forwarding layer. It's front end speaks HTTP and it's back end (where it forwards traffic) is ZeroMQ. It feeds the traffic to whomever picks the forward traffic up. This is a push/pull egress to the app server. The app server processes the request and sends it back over a pub/sub connection.

Hacking document on Sockets: https://github.com/zedshaw/mongrel2/blob/master/docs/manual/hacking.tex#L237

Visualized use of ZeroMQ socket

@rektide
rektide / skills.job.txt
Last active December 20, 2015 10:09
employment checklist
Mayor Fenty
DC Guide
Residents
Business
Visitors
Government
For Kids
DC Networks
HomeSign OutServices for Individuals Services for Employers
Select Your Job Skills
@rektide
rektide / dive-i.md
Last active December 23, 2015 05:39
Cap'n Proto Exploratory Dive Sessions
@rektide
rektide / queue-sequence-spec.js
Created September 20, 2013 19:50
queue-sequence-spec
var Q, Queue
try{
Q= require("q")
}catch(ex){
Q= require("../q")
}
try{
Queue= require("q/queue")
}catch(ex){
@rektide
rektide / gist:6873677
Last active December 24, 2015 22:29
Conjoin matchinglines
input:
["15:19",
"< rektide>",
....
....
....
....],
["15:20",
"< rektide>",
<unit id='toolingorg.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200' singleton='false'>
<provides size='2'>
<provided namespace='org.eclipse.equinox.p2.iu' name='toolingorg.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200'/>
<provided namespace='toolingorg.eclipse.sdk.ide' name='org.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200'/>
</provides>
<requires>
<required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.sdk.ide' range='[0.0.0,5.0.0)'/>
</requires>
<touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
<touchpointData size='1'>
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
set mbox_type=Maildir
set folder="~/.maildir"
set mbox="~/.maildir"
set record="+.sent"
set postponed="+.drafts"
set spoolfile="~/.maildir"
set edit_headers=yes
set editor="vim"
my_hdr Bcc: blah+sent@blah.com
set editor="vim +':set textwidth=112' +':set wrap'"
@rektide
rektide / gist:7349139
Created November 7, 2013 04:51
libfreenect via cmake on tdm-gcc's mingw platfform
D:\utils\lib\libfreenect\mingw>mingw32-make
[ 3%] Building CXX object src/CMakeFiles/freenect.dir/core.c.obj
[ 7%] Building CXX object src/CMakeFiles/freenect.dir/tilt.c.obj
[ 11%] Building CXX object src/CMakeFiles/freenect.dir/cameras.c.obj
[ 14%] Building CXX object src/CMakeFiles/freenect.dir/flags.c.obj
[ 18%] Building CXX object src/CMakeFiles/freenect.dir/usb_libusb10.c.obj
[ 22%] Building CXX object src/CMakeFiles/freenect.dir/registration.c.obj
[ 25%] Building CXX object src/CMakeFiles/freenect.dir/__/platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp.obj
D:\utils\lib\libfreenect\platform\windows\libusb10emu\libusb-1.0\libusbemu.cpp: In function 'void libusb_fill_iso_transfer(libusb_transfer*,
libusb_device_handle*, unsigned char, unsigned char*, int, int, libusb_transfer_cb_fn, void*, unsigned int)':