Skip to content

Instantly share code, notes, and snippets.

@dynaum
dynaum / gist:995961
Created May 27, 2011 19:32
Redis start script
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@dynaum
dynaum / gist:2907055
Created June 10, 2012 19:34
Lista de cidades e estados do Brasil
estados:
- [AC, Acre]
- [AL, Alagoas]
- [AM, Amazonas]
- [AP, Amapá]
- [BA, Bahia]
- [CE, Ceará]
- [DF, Distrito Federal]
- [ES, Espírito Santo]
- [GO, Goiás]
@dynaum
dynaum / application_helper.rb
Created April 14, 2014 15:42
Padrino controller and action names
YourApp::App.helpers do
def dispatcher_route
"#{controller_name}##{action_name}"
end
def controller_name
return :home if route.controller == ""
route.controller
end
systems({
zeus: {
depends: ['poseidon'],
image: "nkwhr/ruby",
provision: [
"bundle install --binstubs --path /azk/bundler",
],
workdir: "/azk/<%= system.name %>",
command: "bin/rackup -p $PORT",
mount_folders: {
@dynaum
dynaum / gist:fae5ff77218cd553a676
Created June 17, 2014 17:41
Azk remove containers
docker rm --force `docker ps --no-trunc -a | grep -v "balancer_redirect" | grep -v "dns.daemon" | awk '{ print $1}' | grep -v "CONTAINER"`
@dynaum
dynaum / .azkfunctions.sh
Last active March 11, 2016 03:33
Azk bash functions
# AZK functions
# Azk shell with bash
function ash() {
APP_DIR=${PWD##*/};
azk shell --shell="/bin/bash" $APP_DIR;
}
# Run shell command
function as() {

Desenvolvedor Front-End

Parafuzo.com

(Rua Frei Galvão, 69, São Paulo - SP || Remoto)

  • Conhecimento necessário:
    • html (5)
    • css (5)
    • javascript (4)
  • bower
@dynaum
dynaum / deputado.coffee
Created April 19, 2016 01:32
Deputado Hubot
module.exports = (robot) ->
list = ['família', 'deus', 'povo', 'democracia']
yorn = ['sim', 'não']
sample = (el) ->
el[parseInt(Math.random() * el.length)]
robot.hear /vote/i, (res) ->
res.send "Por " + [sample(list), sample(list)].join(' e ') + ", meu voto é " + sample(yorn)