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
"Minha vo eh o mestre".split(" ").map{ |c| if c.length > 2; a=c.split(""); "#{a[0]}#{a[1..-2].shuffle}#{a[-1]}" else c end}.join(" ") |
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
# Money.new(12345678901).to_real => "123.456.789,01" | |
def to_real | |
return "0,00" if cents == 0 | |
tmp_money = cents.to_s.split(//) | |
tmp_cents = tmp_money.pop(2).to_s | |
if tmp_money.empty? | |
return ("%.2f" % (tmp_cents.to_i / 100.0)).gsub(".",",") | |
elsif tmp_money.length <= 3 | |
return "#{tmp_money},#{tmp_cents}" | |
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
[renan@kauamanga ruby-money]$ git add . | |
[renan@kauamanga ruby-money]$ git commit -a -m "Fix README" | |
[master]: created 815247f: "Fix README" | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
[renan@kauamanga ruby-money]$ git push | |
Counting objects: 5, done. | |
Compressing objects: 100% (3/3), done. | |
Writing objects: 100% (3/3), 297 bytes, done. | |
Total 3 (delta 2), reused 0 (delta 0) | |
To git@github.com:ShadowBelmolve/money.git |
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 CharTeste | |
attr_reader :sprites, :actions | |
def initialize | |
@sprites = {} | |
#@charDir = $CONF["root"] + '/sprites/teste/' | |
@charDir = '../sprites/teste/' | |
@actions = ["walk"] | |
for i in @actions |
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
<div id='statsholder' style='margin-top:20px;margin-left:20px;width:95%;height:400px;'> | |
[{"data":[[1233579226000,72.0],[1233578616000,85.0],[1233578007000,75.0],[1233577397000,89.0],[1233577068000 | |
,83.0],[1233576431000,0.0],[1233575795000,0.0],[1233575159000,87.0],[1233574523000,49.0],[1233573887000 | |
,0.0],[1233573251000,0.0],[1233572615000,0.0],[1233571979000,0.0],[1233571344000,0.0],[1233570709000 | |
,0.0],[1233570081000,0.0],[1233569473000,0.0],[1233568863000,0.0],[1233568254000,0.0],[1233567642000 | |
,0.0],[1233567035000,0.0],[1233566425000,0.0],[1233565816000,0.0],[1233565207000,0.0],[1233564597000 | |
,0.0],[1233563987000,0.0],[1233563378000,0.0],[1233562767000,0.0],[1233562481000,0.0],[1233365516000 | |
,0.0],[1233364940000,0.0],[1233364303000,0.0],[1233363667000,0.0],[1233363031000,0.0],[1233362396000 | |
,0.0],[1233361760000,0.0],[1233361124000,0.0],[1233360487000,0.0],[1233359852000,0.0],[1233359216000 | |
,0.0],[1233358579000,0.0],[1233357967000,0.0],[1233357357000,0.0],[1233356749000,0.0],[1233356139000 |
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
%table | |
%tr | |
%td | |
Cliente | |
%td | |
= f.select :cliente_id, 0..10, :include_blank => true | |
- fields_for @venda.venda_item do |i| | |
%tr | |
%td | |
Veículos |
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
%table | |
%tr | |
%td | |
Cliente | |
%td | |
= f.select :cliente_id, 0..10, :include_blank => true | |
- f.fields_for @venda.venda_item do |i| | |
%tr | |
%td | |
Veículos |
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
>> a=Money.new(1000) | |
=> #<Money:0xb77d6114 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"USD"=>1.0}, currency"USD", cents1000 | |
>> Money.default_bank.fetch_rates; nil | |
=> nil | |
>> b=Money.new(1500) | |
=> #<Money:0xb77867b8 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"ZAR"=>11.91, "EEK"=>15.6466, "IDR"=>14119.72, "HKD"=>10.2273, "HRK"=>7.3733, "CHF"=>1.5127, "PHP"=>62.81, "NZD"=>2.3137, "INR"=>65.66, "LVL"=>0.7095, "EUR"=>1.0, "THB"=>46.681, "MXN"=>17.1911, "CNY"=>9.0163, "SEK"=>10.934, "HUF"=>293.34, "LTL"=>3.4528, "DKK"=>7.4488, "SGD"=>1.9757, "KRW"=>1761.1, "AUD"=>1.8315, "TRY"=>2.1164, "MYR"=>4.7492, "CAD"=>1.5874, "BRL"=>2.8771, "RON"=>4.2128, "USD"=>1.3196, "PLN"=>4.291, "JPY"=>130.5, "RUB"=>44.047, "CZK"=>26.92, "BGN"=>1.9558, "NOK"=>8.837, "GBP"=>0.8856}, currency"USD", cents1500 | |
>> a | |
=> #<Money:0xb77d6114 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"ZAR"=>11.91, "EEK"=>15.6466, "IDR"=>14119.72, "HKD"=>10.2273, "HRK"=>7.3733, "CHF"=>1.5127, "PHP"=>62.81, "NZD"=>2.3137, "INR"=>65 |
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
>> a=Money.new(1000) | |
=> #<Money:0xb77d6114 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"USD"=>1.0}, currency"USD", cents1000 | |
>> Money.default_bank.fetch_rates; nil | |
=> nil | |
>> b=Money.new(1500) | |
=> #<Money:0xb77867b8 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"ZAR"=>11.91, "EEK"=>15.6466, "IDR"=>14119.72, "HKD"=>10.2273, "HRK"=>7.3733, "CHF"=>1.5127, "PHP"=>62.81, "NZD"=>2.3137, "INR"=>65.66, "LVL"=>0.7095, "EUR"=>1.0, "THB"=>46.681, "MXN"=>17.1911, "CNY"=>9.0163, "SEK"=>10.934, "HUF"=>293.34, "LTL"=>3.4528, "DKK"=>7.4488, "SGD"=>1.9757, "KRW"=>1761.1, "AUD"=>1.8315, "TRY"=>2.1164, "MYR"=>4.7492, "CAD"=>1.5874, "BRL"=>2.8771, "RON"=>4.2128, "USD"=>1.3196, "PLN"=>4.291, "JPY"=>130.5, "RUB"=>44.047, "CZK"=>26.92, "BGN"=>1.9558, "NOK"=>8.837, "GBP"=>0.8856}, currency"USD", cents1500 | |
>> a | |
=> #<Money:0xb77d6114 @bank=#<Money::VariableExchangeBank:0xb77e383c @rates={"ZAR"=>11.91, "EEK"=>15.6466, "IDR"=>14119.72, "HKD"=>10.2273, "HRK"=>7.3733, "CHF"=>1.5127, "PHP"=>62.81, "NZD"=>2.3137, "INR"=>65 |
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
if (typeof formtastic_next_client_id == 'undefined') formtastic_next_client_id = 2; $('#clients').append("<div class='left_column'>\n \n <li class=\"string optional\" id=\"group_clients_name_input\"><label for=\"group_clients_name\">Name</label><input id=\"group_clients_name\" maxlength=\"255\" name=\"group[clients][name]\" size=\"30\" type=\"text\" />\n </li>\n <li class=\"string required\" id=\"group_clients_cpf_input\"><label for=\"group_clients_cpf\">Cpf<abbr title='requerido'>*</abbr></label><input id=\"group_clients_cpf\" maxlength=\"255\" name=\"group[clients][cpf]\" size=\"30\" type=\"text\" />\n </li>\n <li class=\"string required\" id=\"group_clients_rg_input\"><label for=\"group_clients_rg\">Rg<abbr title='requerido'>*</abbr></label><input id=\"group_clients_rg\" maxlength=\"255\" name=\"group[clients][rg]\" size=\"30\" type=\"text\" />\n </li>\n <li class=\"string required\" id=\"group_clients_shipment_input\"><label for=\"group_clients_shipment\">Shipment<abbr title='r |
OlderNewer