Skip to content

Instantly share code, notes, and snippets.

View murilomothsin's full-sized avatar

Murilo Mothsin murilomothsin

  • Taquara - RS
View GitHub Profile
var express = require("express");
var app = express();
var http = require('http');
var request = require('request');
var operators = {
77: 'NEXTEL (SMP)',
78: 'E_NEXTEL (SME)',
23: 'TELEMIG',
12: 'CTBC',

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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script>
window.onload = function () {
document.getElementById("hello").addEventListener("click", function () {
alert("Hello World!");
});
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script type="text/javascript">
window.onload = function () {
document.getElementById("hello").addEventListener("click", function () {
alert("Olá " + document.getElementById("nome").value);
});
@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
Created March 28, 2016 20:37
Init sidekiq script
chkconfig --add sidekiq
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
# sudo start sidekiq index=0
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script type="text/javascript">
window.onload = function () {
document.getElementById("hello").addEventListener("click", function () {
var nome = document.getElementById("nome").value;
var idade = document.getElementById("idade").value;
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script type="text/javascript">
window.onload = function () {
document.getElementById("hello").addEventListener("click", function () {
var nome = document.getElementById("nome").value;
var idade = document.getElementById("idade").value;