Skip to content

Instantly share code, notes, and snippets.

View jacksonpires's full-sized avatar
🏠
Working from home

Jackson Pires jacksonpires

🏠
Working from home
View GitHub Profile
@jacksonpires
jacksonpires / database.yml
Created February 28, 2017 14:03
MySQL database.yml example
production:
adapter: mysql2
encoding: utf8
reconnect: true
database: escamboapp
pool: 5
username: root
password: <sua-senha>
socket: /var/run/mysqld/mysqld.sock
@jacksonpires
jacksonpires / nginx.conf
Last active August 16, 2021 00:27
Arquivo de configuração do NGINX (/etc/nginx/nginx.conf)
user www-data www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
@jacksonpires
jacksonpires / escamboapp
Last active September 24, 2018 19:30
Arquivo de Configuração NGINX/Site (/etc/nginx/sites-enabled/escamboapp)
upstream escamboapp {
server unix:/tmp/escamboapp.sock fail_timeout=0;
}
server {
listen 80;
server_name escamboapp.com.br;
root /var/www/escamboapp/current/public;
index index.html index.htm;
client_max_body_size 10M;
@jacksonpires
jacksonpires / production.rb
Last active September 24, 2018 19:31
Unicorn Configuration (config/unicorn/production.rb)
root = "/var/www/escamboapp/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
worker_processes 4
timeout 30
@jacksonpires
jacksonpires / escamboapp-https
Last active March 1, 2019 05:42
Arquivo de Configuração NGINX/Site (/etc/nginx/sites-enabled/escamboapp) com HTTPS
upstream escamboapp {
server unix:/tmp/escamboapp.sock fail_timeout=0;
}
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
@jacksonpires
jacksonpires / fix.diff
Created April 25, 2017 10:54
Fix Pay Method
diff --git a/app/controllers/sales_controller.rb b/app/controllers/sales_controller.rb
index b06d59c..c575dfb 100644
--- a/app/controllers/sales_controller.rb
+++ b/app/controllers/sales_controller.rb
@@ -78,6 +78,6 @@ class SalesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def sale_params
- params.require(:sale).permit(:date, :buyer, :discount, :pay_method_id, :seller_id, :product_id, :rmk)
+ params.require(:sale).permit(:date, :buyer, :discount, :paymethod_id, :seller_id, :product_id, :rmk)
@jacksonpires
jacksonpires / Dockerfile
Last active July 29, 2019 22:41
Dockerfile for Rails development
FROM ubuntu:16.04
LABEL maintainer="Jackson Pires"
RUN apt-get update
RUN apt-get install -y openssh-server vim curl git sudo
RUN apt-get update
RUN apt-get install -y build-essential automake autoconf \
bison libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \
@jacksonpires
jacksonpires / ng-serve-cloud9.sh
Last active December 19, 2017 13:11
How to run Angular 2+ on Cloud9
ng serve --host $IP --port $PORT --live-reload-port 8081 --public-host https://<project>-<user>.c9users.io/
@jacksonpires
jacksonpires / Vagrantfile
Last active June 1, 2022 18:37
Vagrantfile para a Box Ubuntu Rails Dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "jacksonpires/ubuntu-rails-dev"
config.vm.box_version = "1.0.0"
config.vm.network :forwarded_port, guest: 3000, host: 3000 # rails
config.vm.network :forwarded_port, guest: 9292, host: 9292 # rack
config.vm.network :forwarded_port, guest: 4567, host: 4567 # sinatra
@jacksonpires
jacksonpires / Dockerfile
Last active October 26, 2018 00:15
Dockerfile do Projeto Docker para Desenvolvedores Javascript / Node.JS
FROM node:carbon
WORKDIR /usr/src/app
COPY crud-node-postgres/package*.json ./
RUN npm install
COPY ./crud-node-postgres/ .
RUN npm install -g bower