Skip to content

Instantly share code, notes, and snippets.

View omarkj's full-sized avatar

Omar Yasin omarkj

  • Vancouver, BC, Canada
View GitHub Profile
>>> a = [1,2]
>>> len(a)
2
>>> a[1]
2
2012-02-28 11:49:19.372 [error] <0.4023.0> gen_server <0.4023.0> terminated with reason: no match of right hand value <<"2012-01-09">> in bondscalc_reg:lookup_daily_index/2
@omarkj
omarkj / gist:2146000
Created March 21, 2012 10:21
websocket_handler
%% Feel free to use, reuse and abuse the code in this file.
-module(websocket_handler).
-behaviour(cowboy_http_handler).
-behaviour(cowboy_http_websocket_handler).
-export([init/3, handle/2, terminate/2]).
-export([websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
-record(state, {counter = 0,
[kodiak@kodiak1 proc]$ cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
stepping : 2
cpu MHz : 2399.901
cache size : 12288 KB
fpu : yes
@omarkj
omarkj / gist:3105485
Created July 13, 2012 15:29
build log
==> erlang-ossp-uuid (compile)
uuid-1.6.2/AUTHORS
uuid-1.6.2/BINDINGS
uuid-1.6.2/ChangeLog
uuid-1.6.2/HISTORY
uuid-1.6.2/INSTALL
uuid-1.6.2/MANIFEST
uuid-1.6.2/Makefile.PL
uuid-1.6.2/Makefile.in
uuid-1.6.2/NEWS
{sequential,
[module1,
module2],
{parallel,
[module3,
module4]
},
{finally,
[module5]}},
S = {sequential,[module1,
{sequential, [module2]}
],
{parallel,[module3,
module4],
{sequential,[module5]}
},
{finally, [module6]}
}

XML

<tag-definition>
        <name>NumberOfTrades</name>
          
          
          <value>q</value>
          <type length="10">Integer</type>
      </tag-definition>
@omarkj
omarkj / server.erl
Created November 6, 2012 10:53
Hackney crash on closed remote socket
-module(server).
-export([server/0]).
server() ->
start(hackney),
{ok, Socket} = gen_tcp:listen(0, [binary,{active, true},
{packet, http}]),
{ok, Port} = inet:port(Socket),
spawn(fun() ->
@omarkj
omarkj / exported.md
Last active December 17, 2015 19:58
Exported Resources

Puppet Remote Resources

First I create a define that can, say, create an nginx config file

define nginx::config ($var1, var2) {
  file {
    "/etc/nginx/conf.d/${var1}.conf":
      ensure => present,
 content =&gt; template('nginx/template.erb'),