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
numeros = 0 | |
consecutivos = %W(11 22 33 44 55 66 77 88 99 00) | |
# numeros.txt => http://commondatastorage.googleapis.com/brazil-devrel/numeros.txt | |
a = File.open 'numeros.txt' | |
a.each_line do |number| | |
# Testa para ver se tem consecutivos | |
boolean_consec = false | |
consecutivos.each do |n| | |
boolean_consec = true if number.include? n |
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 = 0 | |
# Inicia em 14614 e vai até 26601 | |
(14614..26601).each do |n| | |
# Incrementa se incluir o numero 6 e NÃO incluir o 1 | |
var += 1 if "#{n}".include? "6" and !"#{n}".include? "1" | |
end | |
puts var | |
# => 1491 |
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
function showNotice(){ | |
alert(this.level + " : " + this.message); | |
}; | |
function notice(level,message){ | |
this.level = level; | |
this.message = message; | |
this.show = showNotice; | |
} | |
var notice01 = new notice("ERRO","Deu Merda..."); |
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 functionTeste = new Function("variavel","texto","alert(variavel+' '+texto)"); //functionTeste('Armando','testando JS!'); | |
var functionTesteDois = new Function("alert('Teste hehehe')"); //functionTesteDois.call(); | |
function photo(nome){ | |
this.name = nome | |
} | |
function planet(nome,tamanho,photo){ | |
this.nome = nome | |
this.tamanho = tamanho | |
//valores default com '||' |
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 produto.codproduto AS Codigo, | |
produtoean.codean AS CodBarra, | |
produto.descricaofiscal AS Descricao, | |
(produtoestab.sldentrada-produtoestab.sldsaida) AS Estoque, | |
produtoestab.custorep AS Custo, | |
produtoestab.precoatc AS VlrVenda, | |
(CASE WHEN produtoestab.custorep = 0 THEN 0 | |
WHEN produtoestab.precoatc = 0 THEN 0 | |
ELSE ((produtoestab.precoatc/produtoestab.custorep)-1)*100 END) AS MargemUtilizada, | |
'__________' AS PrecoVenda |
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
CREATE TABLE administestabelec ( | |
codestabelec integer NOT NULL, | |
codadminist integer NOT NULL, | |
percdescto numeric DEFAULT 0 NOT NULL, | |
valdescto numeric DEFAULT 0 NOT NULL, | |
taxaenvio numeric DEFAULT 0 NOT NULL, | |
diaenvio integer DEFAULT 0 NOT NULL, | |
usuario character varying(20), | |
datalog date | |
); |
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
vim | |
vim [opções] [arquivo] | |
São algumas das opções deste aplicativo | |
-b : permite editar arquivo binário. | |
-h : exibe opções do aplicativo. | |
+n : inicializa o cursor na n-ésima linha. |
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
Vamos iniciando a instalação com os seguintes comandos: | |
# apt-get install postgresql pgadmin3 | |
Instalação feita, o próximo passo é alterar a senha do usuário postgres: | |
# su postgres -c psql postgres | |
ALTER USER postgres WITH PASSWORD 'senha'; |
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
ERRO> | |
armando@ubuntu:~$ gem install bundler | |
ERROR: Loading command: install (LoadError) | |
no such file to load -- zlib | |
ERROR: While executing gem ... (NameError) | |
uninitialized constant Gem::Commands::InstallCommand | |
faça>> |
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
# Comando: | |
$ chmod 777 nomeDaPasta | |
o parametro -R aplica as subpastas tbem: | |
$ chmod -R 777 pasta | |
>> pra tentar entender o 777 : http://www.degahosting.net/knowledgebase.php?action=displayarticle&id=94 |
OlderNewer