Skip to content

Instantly share code, notes, and snippets.

View murilomothsin's full-sized avatar

Murilo Mothsin murilomothsin

  • Taquara - RS
View GitHub Profile

Use apache2 with Passenger

Required

  • CentOS
$ cat /etc/redhat-release 
CentOS release 6.5 (Final)
  • gcc-c++
@murilomothsin
murilomothsin / user.rb
Last active August 29, 2015 14:27 — forked from estum/user.rb
Migrate passwords from legacy systems to Devise
# updated variant of older solution:
# http://www.davidverhasselt.com/2012/05/13/how-to-migrate-passwords-from-legacy-systems-to-devise
class User < ActiveRecord::Base
# ...
def valid_password?(password)
if legacy_password?
# Use Devise's secure_compare to avoid timing attacks
@murilomothsin
murilomothsin / redis-server
Created March 28, 2016 13:59 — forked from tessro/redis-server
A CentOS initscript for Redis
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@murilomothsin
murilomothsin / config.json
Created May 30, 2016 14:49 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@murilomothsin
murilomothsin / pub-sub.js
Created July 12, 2017 19:40 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
/*
* Original script by: Shafiul Azam
* Version 4.0
* Modified by: Luigi Balzano
* Description:
* Inserts Countries and/or States as Dropdown List
* How to Use:
In Head section:
@murilomothsin
murilomothsin / puma.rb
Created November 30, 2017 22:58 — forked from aconfee/puma.rb
/myapp/config/puma.rb
# Change to match your CPU core count
workers 1
# Min and Max threads per worker
threads 1, 6
directory "/home/rails/RubyFinanceTracker"
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"
@murilomothsin
murilomothsin / useful_git.md
Created January 29, 2018 11:01
Some useful Git commands I use in a regular basis

Basic Commands

Updating your project with new information from Github

This command will update the references/branches locally on your machine and notify about deleted branches from origin

git fetch -p

Creating a new working branch

Before creating a branch, update your project, after that, go to master branch and then run the command: