Skip to content

Instantly share code, notes, and snippets.

@leandrosilva
leandrosilva / __init__.py
Created January 22, 2011 02:15
Just a dummy abstraction for a Redis-based cache (in Python)
"""
Cachedis
~~~~~
Just a dummy abstraction for a Redis-based cache.
https://gist.github.com/790787
:copyright: (c) 2010 by Leandro Silva (CodeZone).
:license: Just FREE.
@leandrosilva
leandrosilva / HOWTO
Created March 2, 2011 18:10
Ivy and IronHammer on Mac OS X
To use Ivy and Iron Hammer on Mac OS X follow these steps:
1. Clone my fork of IronHammer repository at Github:
$ git clone https://github.com/leandrosilva/Iron-Hammer.git
2. Create a .settings directory (or some other name you prefer) with a layout like this:
.settings
|
@leandrosilva
leandrosilva / HOWTO
Created March 3, 2011 17:44
Ivy and Iron Hammer on Mac OS X
To use Ivy and Iron Hammer on Mac OS X follow these steps:
1. Download and extract Ivy to /opt/ivy (or other place you want)
2. Clone my fork of IronHammer repository at Github:
$ git clone https://github.com/leandrosilva/Iron-Hammer.git
3. Create a .settings directory (or some other name you prefer) with a layout like this:
@leandrosilva
leandrosilva / README
Created March 10, 2011 23:22
Sample on how I use websocket_client to test Erlang WebSocket-based applications
This is a quick sample on how I have used websocket_client to test Erlang WebSocket-based applications. To
taste it you will need to have a copy of websocket_client from my fork, available at:
https://github.com/leandrosilva/erlang_websocket/blob/master/src/websocket_client.erl
The websocket_client module was made by Dave Bryson on erlang_websocket project:
https://github.com/davebryson/erlang_websocket
Enjoy!
@leandrosilva
leandrosilva / Makefile
Created March 11, 2011 15:58
Makefile to compile, run, and test Erlang applications
APP_NAME := my_awesome_app
all: compile
compile: clear
@cp src/$(APP_NAME).app ebin/
@erlc -pa ebin/ -o ebin/ src/*.erl
compile_test: compile
@erlc -pa ebin/ -o ebin/ test/*.erl
@leandrosilva
leandrosilva / README
Created May 29, 2011 02:04
Playing with Clojure, Redis, Compojure, and Jedis library
As always, I'm just playing with interesting things to relax a little bit. Just it.
== 1. Dependencies
I tried to use redis-clojure but it sucks and I shifted to Jedis which rocks. So if you want to try
as well, this little joke (ops! I mean...) program depends on:
* org.clojure/clojure "1.2.0"
* org.clojure/clojure-contrib "1.2.0"
* redis.clients/jedis "1.5.2"
@leandrosilva
leandrosilva / replacer
Created July 5, 2011 00:02
Command line utility to replace file names
#!/usr/bin/env ruby
# Example:
#
# $ ./replacer foo bar *.*
#
# foo.app > bar.app
# foo.erl > bar.erl
# foo_app.erl > bar_app.erl
# foo_sup.erl > bar_sup.erl
@leandrosilva
leandrosilva / syslog_config.hrl
Created July 26, 2011 14:23
erlang_syslog configuration based on log level
%%
%% erlang_syslog
%% https://github.com/JacobVorreuter/erlang_syslog
%%
%% erlc -D log_info awesome_module.erl
%%
-ifdef(log_debug).
-define(DEBUG(Msg), erlang:apply(syslog, debug, [cameron_syslog, Msg])).
-define(DEBUG(Msg, Args), erlang:apply(syslog, debug, [cameron_syslog, io_lib:format(Msg, Args)])).
@leandrosilva
leandrosilva / ElasticSysjog.java
Created July 28, 2011 17:22
Nano Syslog deamon + ElasticSearch back-end for awesomeness
import java.net.*;
import java.io.*;
public class ElasticSysjog {
public static void main(String[] args) throws IOException {
System.out.println("=== ElasticSysjog up and running ===");
final int PORT = 1514; // default Syslog UDP port is 514
final int BUFFER_SIZE = 10000;
@leandrosilva
leandrosilva / dev
Created August 22, 2011 15:09
rebar-conversion
leandro@codezone ~/Projects/erlang/kelly/cameron (rebar-conversion)
$ make devclean
rm -rf dev
leandro@codezone ~/Projects/erlang/kelly/cameron (rebar-conversion)
$ make devrel
./rebar get-deps
==> misultin (get-deps)
==> redo (get-deps)
==> erl_helpers (get-deps)