Skip to content

Instantly share code, notes, and snippets.

View omarkj's full-sized avatar

Omar Yasin omarkj

  • Vancouver, BC, Canada
View GitHub Profile
{"slug":"testapp1-1470245742996",
"name":"testApp1",
"preferences": {"categories": [
{"name":"Likes","matches":["(.*) liked your photo"],"example":"Barry liked your photo"},
{"name":"New Users","matches":["Your Facebook friend (.*) is on Instagram as (.*)."],"example":"Your Facebook friend Barry Jones is on Instagram as barry_jones."},
{"name":"Breaking","matches":["Breaking: (.*)"],"example":"Breaking: The end of the world has arrived"}
]}}
@omarkj
omarkj / terrible_thing.js
Created January 29, 2016 19:44
Testing against DynamoDB local and Kinesalite
#!/usr/bin/env node
const http = require('http');
const bind = '127.0.0.1';
const port = 8081;
const port_map =
{'Kinesis': 4567, 'DynamoDB': 8000};
http.createServer((req, res) => {
var amz_target = req.headers['x-amz-target'].split('_')[0];
var proxy_req_opts = {
host: '127.0.0.1',
@omarkj
omarkj / exec.md
Created January 24, 2016 03:07
Exec
exec([fun fun1/3, fun fun2/4, fun fun3/1], [Arg1, Arg2, Arg2]).

fun1(Arg1, Arg2, Arg3) ->
  P = proplists:get_value(p, Arg1),
  {ok, [P, Arg1, Arg2, Arg3]}.

fun2(P, Arg1, Arg2, Arg3) ->
  do_stuff(P, Arg1, Arg2),
 {ok, [Arg3]}.
@omarkj
omarkj / keybase.md
Last active November 10, 2017 17:37

Keybase proof

I hereby claim:

  • I am omarkj on github.
  • I am omarkj (https://keybase.io/omarkj) on keybase.
  • I have a public key ASC58LxwccHQSu_i0qYq-dGdjbBh4FWELX3m_eQrkUBmlgo

To claim this, I am signing this object:

function heroku {
if [[ $* != *-a* ]]; then
echo "Specify an app with --app/-a"
else
heroku $*
fi
}

Keybase proof

I hereby claim:

  • I am omarkj on github.
  • I am omarkj (https://keybase.io/omarkj) on keybase.
  • I have a public key whose fingerprint is 711D B937 EBAF E274 F820 A11D A55A 9808 8B30 41FB

To claim this, I am signing this object:

@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 => template('nginx/template.erb'),
@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() ->

XML

<tag-definition>
        <name>NumberOfTrades</name>
          
          
          <value>q</value>
          <type length="10">Integer</type>
      </tag-definition>
S = {sequential,[module1,
{sequential, [module2]}
],
{parallel,[module3,
module4],
{sequential,[module5]}
},
{finally, [module6]}
}