This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery Plugin Boilerplate | |
// A boilerplate for jumpstarting jQuery plugins development | |
// version 1.1, May 14th, 2011 | |
// by Stefan Gabos | |
// http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/#requirements | |
// remember to change every instance of "pluginName" to the name of your plugin! | |
(function($) { | |
// here we go! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_filter :session_expiry, :except => [:login, :logout] | |
before_filter :update_activity_time, :except => [:login, :logout] | |
def session_expiry | |
@time_left = (session[:expires_at] - Time.now).to_i | |
unless @time_left > 0 | |
reset_session | |
flash[:error] = 'Sua sessão expirou. Favor entrar novamente.' | |
redirect_to :controller => 'login', :action => 'login' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adapted from here: http://ostermiller.org/calc/encode.html | |
var base64 = {}; | |
(function () { | |
var END_OF_INPUT = -1, | |
base64Chars = new Array( | |
'A','B','C','D','E','F','G','H', | |
'I','J','K','L','M','N','O','P', | |
'Q','R','S','T','U','V','W','X', | |
'Y','Z','a','b','c','d','e','f', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Jquery and Rails powered default application.js | |
Easy Ajax replacement for remote_functions and ajax_form based on class name | |
All actions will reply to the .js format | |
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link | |
respond_to do |format| | |
format.html | |
format.js {render :layout => false} | |
end | |
*/ |
NewerOlder