Skip to content

Instantly share code, notes, and snippets.

View gullitmiranda's full-sized avatar
🌎
Working from anywhere

Gullit Miranda gullitmiranda

🌎
Working from anywhere
View GitHub Profile
@gullitmiranda
gullitmiranda / help.js
Last active August 29, 2015 14:23
`cli-router` help controller
// JS usando ES6
var chalk = require('chalk');
var CliControllers = require('cli-router').CliControllers;
class Help extends CliControllers.Help {
index(params, cli) {
var usage = super.index(params, cli);
usage = this.colorizeSections(params, usage);
console.log(usage);
return 0;
@gullitmiranda
gullitmiranda / example.js
Last active August 29, 2015 14:23
How we did it `azk` CLI.
#!/usr/bin/env node
var Cli = require('cli-router').Cli;
var cli = new Cli({
// Caminho para o arquivo de usage (seguindo o padrão do docopt.
path: path.join(__dirname, `usage.txt`),
// Diretório onde estão os controladores
controllers_root: path.join(__dirname, "controllers")
});
cli
@gullitmiranda
gullitmiranda / docker_cheat_sheet.md
Last active May 11, 2016 02:35
Clean Docker images and containers cheat sheet.

Docker Cheat Sheet

NOTE: if you are using the docker without the http://azk.io installed, use docker instead of adocker.

Kill running containers

adocker kill $(adocker ps -q | tr '\r\n' ' ')
@gullitmiranda
gullitmiranda / database.uri.exs
Created June 8, 2015 22:44
Configuration to Ecto use DATABA_URL
use Mix.Config
# Configure your database
config :hello_phoenix, HelloPhoenix.Repo,
adapter: Ecto.Adapters.Postgres,
url: {:system, "DATABASE_URL"}
@gullitmiranda
gullitmiranda / Azkfile.js
Last active August 29, 2015 14:22
Azkfile.js to Elixir + Phoenix + Postgres
**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
"hello_phoenix": {
// Dependent systems
depends: ['postgres'], // postgres, mysql, mongodb ...
// More images: http://images.azk.io
@gullitmiranda
gullitmiranda / Azkfile.js
Last active August 29, 2015 14:21 — forked from marioidival/Azkfile.js
Pyramid with Python 3.4 - Azkfile.js
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
"pyramid": {
// Dependent systems
depends: [],
// More images: http://images.azk.io
@gullitmiranda
gullitmiranda / default.conf
Created May 23, 2015 03:00
PHP5 + Apache2 default site
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www;
index index.html index.php;
# Make site accessible from http://localhost/
server_name localhost;
@gullitmiranda
gullitmiranda / Dockerfile
Created April 27, 2015 18:38
Dockerfile to ruby 2.1.2
# The container includes:
#
# azukiapp/ruby:
# * MRI Ruby 2.1.4
# * Bundler
# * Image Magick
#
FROM azukiapp/node
MAINTAINER Azuki <support@azukiapp.com>
@gullitmiranda
gullitmiranda / Azkfile.js
Last active August 29, 2015 14:20
Azkfile by Magnetis
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
magnetis: {
// Dependent systems
depends: ["postgres", "redis", "elasticsearch"],
// More images: http://images.azk.io