Skip to content

Instantly share code, notes, and snippets.

View rafaeljesus's full-sized avatar

Rafael Jesus rafaeljesus

  • Berlin, Germany
View GitHub Profile
dependencies:
cache_directories:
- "~/zookeeper-3.4.5"
- "~/kafka_2.8.0-0.8.0"
pre:
- "[[ -d ~/zookeeper-3.4.5 ]] || ( curl -L -o ~/zookeeper.tar.gz 'http://mirror.cogentco.com/pub/apache/zookeeper/current/zookeeper-3.4.5.tar.gz' && tar -xz -C ~ -f ~/zookeeper.tar.gz )"
- "[[ -d ~/kafka_2.8.0-0.8.0 ]] || ( curl -L -o ~/kafka.tar.gz 'http://mirror.metrocast.net/apache/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz' && tar -xz -C ~ -f ~/kafka.tar.gz )"
- cp ~/zookeeper-3.4.5/conf/zoo_sample.cfg ~/zookeeper-3.4.5/conf/zoo.cfg
- ~/zookeeper-3.4.5/bin/zkServer.sh start
package main
import (
"fmt"
"log"
"net/http"
"html/template"
"github.com/gorilla/sessions"
@rafaeljesus
rafaeljesus / Rakefile
Created July 30, 2016 23:30 — forked from schickling/Rakefile
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@rafaeljesus
rafaeljesus / introrx.md
Created July 9, 2016 15:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@rafaeljesus
rafaeljesus / API.md
Created June 5, 2016 15:30 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@rafaeljesus
rafaeljesus / README.md
Created May 26, 2016 05:39 — forked from ArturT/README.md
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

Extra note

@rafaeljesus
rafaeljesus / js-micro.js
Created May 16, 2016 20:15 — forked from yuval-a/js-micro.js
Javascript micro-optimizations
// Array literal (= []) is faster than Array constructor (new Array())
// http://jsperf.com/new-array-vs-literal/15
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
// http://jsperf.com/new-array-vs-literal/26
var obj = {};
// property === undefined is faster than hasOwnProperty(property)
// http://jsperf.com/hasownproperty-vs-in-vs-undefined/17
@rafaeljesus
rafaeljesus / INSTALLATION.md
Created May 4, 2016 02:06 — forked from DenisIzmaylov/INSTALLATION.md
DigitalOcean Dokku: fresh install with Node.js Environment

DigitalOcean Dokku / Node.js Cloud Environment

Custom recipe to get full Node.js Cloud Environment in DigitalOcean Dokku droplet running from scratch. Yes. Your own Heroku for $5 per month.

I use this gist to keep track of the important configuration steps required to have a functioning system after fresh install.

When you have executed that's all step by step you will get a new working and stable system which is ready to host & serve your Node.js application and databases.

@rafaeljesus
rafaeljesus / cover-letter.md
Created April 28, 2016 01:08 — forked from creeonix/cover-letter.md
How to write a cover letter

Dear XCorp / Hi, XCorp depending on familiarity

I'm writing in response to X, where you advertised a vacancy for Y. I am interested in applying for this role -- please find my CV attached.

My current employment position is X, which means I'm responsible for delivering/organising/producing A, B, and C. I was previously the Y at Z where I did D. My main responsibility / largest project here has been P, which is a Widget that produces Doo-dads.

While I enjoy working at X for reasons K and L, I find M frustrating. I'm also looking to move on into areas such as N, P and Q, without losing touch with K. I find K valuable but I would prefer to change my working environment to include P.

I'm particularly interested in XCorp because, as well as providing the career experience I'm after, I use your product / admire your work / look up to your staff for these reasons: ...

@rafaeljesus
rafaeljesus / nodejs-cluster-zero-downtime.md
Created March 11, 2016 23:32 — forked from jedi4ever/nodejs-cluster-zero-downtime.md
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)