Skip to content

Instantly share code, notes, and snippets.


Ricardo do Valle ricardodovalle

  • São Paulo, Brazil
View GitHub Profile
ricardodovalle / puma.service
Created Sep 27, 2017 — forked from arteezy/puma.service
Manage Puma with systemd on Ubuntu 16.04 and rbenv
View puma.service
Description=Puma Rails Server
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
ricardodovalle / 1 setup vps
Created Sep 26, 2017 — forked from AlekPopovic/1 setup vps
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
View 1 setup vps
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL | sudo -E bash -
ricardodovalle / inputmask.js
Created Jun 2, 2015
Meteor with "bigdsk:inputmask"
View inputmask.js
// Config file at "client/lib/inputmask.js" - I used this to create a new mask type
$.extend($.inputmask.defaults.definitions, {
H: {
validator: '[0-9a-fA-F]',
cardinality: 1
View meteor pagination class
Meteor pagination class
UsersController = RouteController.extend
waitOn: ->
@page = || 1
@pagination = new, selector, {page: @page})

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

View .vimrc
" Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
View form.rb
= simple_form_for person, remote: true do |f|
= f.fields_for :address do |builder|
= render 'form_address', f: builder
View rspec_model_testing_template.rb
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
# @kyletcarlson
# This skeleton also assumes you're using the following gems:
View .zshrc
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
ricardodovalle / foreman.rb
Created Jul 9, 2014
Only a foreman sudo approch (not working)
View foreman.rb
namespace :foreman do
desc <<-DESC
Export the Procfile to upstart.
You can override any of these defaults by setting the variables shown below.
set :foreman_cmd, "foreman"
set :foreman_format, "upstart"
set :foreman_location, "/etc/init"
set :foreman_port, 5000