This file contains 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
var specialChars = [ | |
{val:"a",let:"áàãâä"}, | |
{val:"e",let:"éèêë"}, | |
{val:"i",let:"íìîï"}, | |
{val:"o",let:"óòõôö"}, | |
{val:"u",let:"úùûü"}, | |
{val:"c",let:"ç"}, | |
{val:"A",let:"ÁÀÃÂÄ"}, | |
{val:"E",let:"ÉÈÊË"}, | |
{val:"I",let:"ÍÌÎÏ"}, |
This file contains 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
namespace :deploy do | |
desc "Symlinks the database.yml" | |
task :symlink_db, :roles => :app do | |
run "ln -nfs /home/#{user}/#{domain}/shared/database.yml #{release_path}/config/database.yml" | |
end | |
end |
This file contains 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
def to_param | |
"#{id}-#{attribute.downcase.parameterize}" | |
end |
This file contains 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
I18n.locale = :'pt-BR' # or whatever your default locale is | |
I18n.load_path += Dir[Rails.root.join("config/locales/**/*.yml")] | |
I18n.reload! |
This file contains 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
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # guest user (not logged in) | |
if user.type == 'Admin' | |
can :manage, [ThematicGroup, Coordinator] | |
can [:read, :edit, :update], MiniCourse | |
can :read, Participant | |
can :panel, Admin |
This file contains 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
!!! | |
%head | |
%meta{:charset => "utf-8"} | |
%meta{:author => "Brenno Costa"} | |
%title Application Layout Hamlfy | |
=stylesheet_link_tag "application" | |
=javascript_include_tag "application" | |
=csrf_meta_tags | |
%body |
This file contains 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
group :assets do | |
gem 'sass-rails', '~> 3.1.0' | |
gem 'coffee-rails', '~> 3.1.0' | |
gem 'uglifier' | |
gem 'compass', '~> 0.12.alpha' | |
# include other compass plugins here. E.g.: | |
gem 'compass-susy-plugin', :require => 'susy' | |
end |
This file contains 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
$("select").change(function() { | |
var form = $(this.form); | |
$.post( | |
form.attr("action"), | |
form.serialize(), | |
null, | |
"script" // Datatype needed to format.js work | |
); | |
return false; | |
}); |
This file contains 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
#!/usr/bin/env bash | |
# | |
# install all of http://github.com/phuibonhoa's TM bundles (OS X only) | |
# | |
echo "Installing bundles..." | |
# backup dir | |
if [ -d ~/desktop/_tm_bundle_backups ]; then rm -rf ~/desktop/_tm_bundle_backups; fi |
This file contains 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/bash | |
# NGINX RC.D SCRIPT | |
# Archlinux | |
NGINX_CONFIG="/opt/nginx/conf/nginx.conf" | |
NGINX_BIN="/opt/nginx/sbin/" | |
#. /etc/conf.d/nginx | |
. /etc/rc.conf | |
. /etc/rc.d/functions |
OlderNewer