Skip to content

Instantly share code, notes, and snippets.

@dry
dry / exec.md
Created January 29, 2016 17:45 — forked from omarkj/exec.md
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]}.
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
import unittest, os, os.path, sys, urllib
import tornado.database
import tornado.options
from tornado.options import options
from tornado.testing import AsyncHTTPTestCase
# add application root to sys.path
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(APP_ROOT, '..'))
@dry
dry / sample output
Last active December 11, 2015 16:19 — forked from josevalim/sample output
defmodule Chat.Client do
# In all of the following functions 'server' stands for the server's pid
def join({server, name}) do
send server, {name, :join, ""}
end
def say({server, name, message}) do
send server, {name, :say, message}
end
@dry
dry / date_util.erl
Created December 20, 2012 21:15 — forked from zaphar/date_util.erl
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
@dry
dry / gist:4017752
Created November 5, 2012 15:22 — forked from ckimrie/gist:3312619
Example extension that allows you to modify the final ExpressionEngine CP output
<?php
/**
* Modifying the final CP Output
*
* This extension demonstrates how you can access and modify the final ExpressionEngine
* CP output. It is not a hack, but it is a new technique that to my knowledge has not
* been used before in an EE addon.
*
* This has not been road tested and its side effects are unknown, so use this at your own risk.
@dry
dry / bash.sh
Created October 28, 2012 00:58 — forked from nstielau/bash.sh
Set node attributes, run_list, chef_environment, etc
knife node configure my_node.example.com