Skip to content

Instantly share code, notes, and snippets.


Luiz Picolo ツ luizpicolo

Block or report user

Report or block luizpicolo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .railsrc
# .railsrc
-B #Skip Bundle
-T #Skip Test-Unit
-d postgresql #Use postgres
View gist:6255a525b44de36e9684ed9e25b135c4
const storage = multer.diskStorage({
destination: function(req, file, cb){
cb(null, 'public/uploads/');
filename: function(req, file, cb){
cb(null, `${file.filename}-${}.${path.extname(file.originalname)}`);
View server.js
const http = require('http');
const port = 3000;
const ip = '';
const server = http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<h1>Instituo Federal de Mato Grosso do Sul!</h1>')
server.listen(port, ip, function() {
View aula_sobre_IO_serializacao.rb
class Livro
attr_accessor :titulo, :categoria, :autor, :isbn
def initialize(titulo, categoria, autor, isbn)
@titulo = titulo
@categoria = categoria
@autor = autor
@isbn = isbn
View aula_sobre_IO.rb
def salvar_livro(livro_attrs = {})'livros', 'a') do |livro|
livro_attrs.each {|k, v| livro.puts "#{k}: #{v}" }
def condicional_para_saida(condicional)
return false if condicional == 2
return true
luizpicolo / Exercicios5
Last active Aug 11, 2018 — forked from lrlucena/Exercicios5
Lista de Exercícios 5 da disciplina de Programação de Computadores
View Exercicios5
#encoding: utf-8
# Escreva um programa que leia um número e mostre se ele é igual a 10.
puts "Digite um número: "
x = gets.to_i
if x==10 then
puts "O valor digitado foi 10."
puts "O valor digitado não foi 10."
luizpicolo / app.rb
Last active Jul 16, 2018 — forked from hendrikswan/app.rb
sample sinatra mongodb service
View app.rb
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
class Price
include Mongoid::Document
luizpicolo /
Created Jul 17, 2017 — forked from tomas-stefano/
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
View PG Dump Dokku
This is what I would do to backup my old database and restore
To back up your database
pg_dump --format=c olddb_name > db_dump_file.dump
To restore that backup
pg_restore -v -d newdb_name db_dump_file.dump
Read more on pg_dump and pg_restore


cribbed from

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.


# Namespace for classes and modules that handle serving documentation over HTTP
You can’t perform that action at this time.