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
| var total = 100; | |
| Math.round((total/12)*100)/100; | |
| // 8.33 | |
| var parcela = Math.round((100/12)*100)/100 | |
| // undefined | |
| parcela | |
| // 8.33 |
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
| def require_role_for_assessoria | |
| return if current_user.have_role?(:assessoria) | |
| return if current_user.have_role?(:admin) | |
| redirect_to_dashboard | |
| end | |
| def require_role_for_servico | |
| return if current_user.have_role?(:servico) | |
| return if current_user.have_role?(:admin) |
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
| t1 = Thread.new do | |
| puts "Na thread 1" | |
| sleep(6) | |
| puts "ainda na thread 1" | |
| sleep(3) | |
| puts "fim da thread 1" | |
| end | |
| t2 = Thread.new do | |
| puts "Na thread 2" |
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
| SELECT produto.* | |
| FROM ( | |
| SELECT DISTINCT produto.codproduto | |
| ,produto.descricaofiscal | |
| ,(SELECT valor FROM produtocompl WHERE codcomplcadastro = 15 AND codproduto = produto.codproduto ) AS descricaoclientes | |
| ,pe.codestabelec | |
| ,dep.coddepto | |
| ,dep.nome AS departamento | |
| ,gru.codgrupo | |
| ,gru.descricao AS grupo |
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
| <html> | |
| <head> | |
| <title>Teste</title> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).bind("ready",function(){ | |
| alert('Disparado pelo ready'); | |
| $("#btnTeste").trigger("click"); | |
| }); | |
| </script> |
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
| # Schema usado nos testes | |
| # | |
| #ActiveRecord::Schema.define(:version => 20120817041434) do | |
| # | |
| # create_table "budgets", :force => true do |t| | |
| # t.string "name" | |
| # t.datetime "created_at", :null => false | |
| # t.datetime "updated_at", :null => false | |
| # 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
| CREATE OR REPLACE FUNCTION stpr_lancamentogru_lancamento() | |
| RETURNS "trigger" AS | |
| $BODY$ | |
| DECLARE i integer; -- Variavel com o numero de parcelas | |
| DECLARE j integer; -- Contador para gerar o numero de parcelas baseado em 'j' | |
| DECLARE dia integer; -- Contador usado para varrer a tabela condpagto | |
| DECLARE percdia numeric(9,4); -- Contador usado para varrer a tabela condpagto | |
| DECLARE var_codlancto integer; -- Usado para calcular o valor da diferenca apos parcelar | |
| DECLARE var_valorparcela numeric(12,2); -- Valor das parcelas a cada lancamento |
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
| //Fonte do site original no final | |
| Como criar Snippets no Sublime Text 2 – Rápido, prático, útil e sexy. | |
| Publicado em 11 de março de 2012 por ofelquis | |
| Olá pessoal, este é o primeiro post que escrevo em que falo sobre usar uma IDE, neste post não vou falar sobre a IDE, mas sim em como criar snippets para uma IDE, a que usarei de exemplo é Sublime Text 2, uma IDE praticamente free que é muito rápida e muito usada por profissionais Front-End e outros. | |
| Snippets são pequenos (ou não) trechos de código que são ativados através de um autocompletar de texto na IDE, por exemplo, começamos a digitar ‘add’ e a IDE sugere para completar o que estou escrevendo o seguinte código |
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
| config.action_mailer.delivery_method = :sendmail | |
| config.action_mailer.sendmail_settings = { | |
| :location => '/usr/sbin/sendmail', | |
| :arguments => '-i -t' | |
| } |
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
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ManterPagamento._Default" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" > | |
| <head runat="server"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> |