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
# no ApplicationHelper... | |
def toolbar(module_name,id,options={}) | |
acesso_geral = current_usuario.send("may_gerenciar_#{module_name}?") | |
acesso_edit = current_usuario.special_permissions.updatable(module_name).exists? | |
acesso_read = current_usuario.special_permissions.readable(module_name).exists? | |
acesso_delete = current_usuario.special_permissions.deletable(module_name).exists? | |
concat("<span class='toolbar'>") | |
if(acesso_geral || acesso_edit) && (options[:actions].include?(:edit)) | |
concat(link_toolbar(module_name,id,"edit","Editar")) | |
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
!!! Strict | |
%html{html_attrs} | |
%head | |
%title | |
= h(yield(:title) || "..:: Daiwa Isenções ::..") | |
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ | |
= stylesheet_link_tag 'application' | |
= stylesheet_link_tag 'formtastic' | |
= stylesheet_link_tag 'redmond/jquery-ui-1.8rc3.custom.css' | |
= stylesheet_link_tag 'demo_table_jui.css' |
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 datatable_ajax(modelo,opcoes={}) | |
options = {:limit => params[:iDisplayLength], :offset => params[:iDisplayStart], :order => [], :include => []} | |
conditions = [] | |
tabela_pai = modelo.to_s.tableize | |
@ordem = criar_array_de_ordenacao | |
opcoes[:campos].each_with_index do |v,i| | |
if @ordem.include?(i.to_s) | |
options[:order] << formatar_campo_ordem(tabela_pai,v,params["sSortDir_#{@ordem.index(i.to_s)}"]) | |
end | |
includes = include_tabela_campo(v) |
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
require 'benchmark' | |
require 'sexpistol' | |
require 'sxp' | |
require 'strscan' | |
class Lexer < StringScanner | |
def next_token | |
# Housekeeping. | |
skip /\s*/ |
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
# URL do sistema | |
URL = "http://#{window.location.host}/aplic/eventos_internos" | |
# Classe que contém o comportamento geral do sistema. | |
VM = | |
loading: KO false | |
evento: KO new Evento() | |
tipos_de_evento: ['CURSO','PALESTRA','FEIRA','JORNADA','SEMINÁRIO','CONGRESSO','WORKSHOP','OUTROS'] | |
cursos: KO [] | |
estados: KO [] | |
cidades: KO [] |
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
/** URL do sistema */ | |
var URL = "http://"+window.location.host+"/aplic/eventos_internos"; | |
/** | |
* Classe que contém o comportamento geral do sistema. | |
* @name VM | |
* @class | |
*/ | |
var VM = { | |
loading: KO(false), | |
evento: KO(new Evento()), |
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/sh | |
# use my inotify-tools fork at https://github.com/thelinuxlich/inotify-tools | |
# use my docco fork if you want to generate php documentation(npm install thelinuxlich-docco) | |
while output=`inotifywait -r -e create -e close_write -e modify --format '%w %f' --include ".*\.(coffee|php)$" /srv/www/htdocs/php/`; do | |
DIR=${output%% *} | |
DOCDIR=${DIR/php\//php\/docs/} | |
FILE=${output#* } | |
echo "Detected a change in ${DIR}${FILE} ..." >> /srv/www/htdocs/php/logs/watcher.log | |
if [[ $FILE == *.coffee* ]] | |
then |
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
# Modelo do evento para persistência no banco de dados. | |
class @Evento | |
constructor: -> | |
@descricao.subscribe ((value) -> | |
if value.length > 4000 | |
@descricao value.substr(0, 4000) | |
).bind @ | |
@tipo.subscribe ((value) -> | |
if value isnt "OUTROS" | |
@outro_tipo "" |
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
VM = | |
evento: KO new Evento() |
OlderNewer