Skip to content

Instantly share code, notes, and snippets.

View washingtonsoares's full-sized avatar
🎯
Focusing

Washington Soares washingtonsoares

🎯
Focusing
View GitHub Profile
comprimento :: [Char]->Int
comprimento [] = 0
comprimento (p:r) = 1 + comprimento(r)
pertence :: Int-> [Int] -> Bool
pertence x [] = False
pertence x (p:r) = if(x == p) then True else pertence x (r)
maior :: [Int]->Int
wget -q -U Mozilla -O output2.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=Test&tl=En-gb"
@washingtonsoares
washingtonsoares / BotãoWhatsApp.html
Created April 24, 2016 17:06 — forked from lucianobragaweb/BotãoWhatsApp.html
Como abrir o WhatsAPP no seu site
<!--
Subistitua o Número(8888387788) pelo seu número do WhatsApp
Siga este padrão: DDD + Numero, ex: 88 8838 7788 (Meu Número Whats)
-->
<a href="intent://send/8888387788#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">Vamos Conversar?</a>
@washingtonsoares
washingtonsoares / postgresql_configuration_on_ubuntu_for_rails.md
Created April 11, 2016 23:18 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
null1 :: [a] -> Bool
null1 lista = if(length lista > 0) then False else True
safetail1 :: [Int] -> [Int]
safetail1 lista = if(null lista == True) then [] else tail lista
safetail2 :: [Int] -> [Int]
safetail2 lista
| otherwise = tail lista
| null lista == True = []
iguais :: (Int, Int, Int)-> Int
iguais (x, y, z)
| x == y && y == z = 3
| x == y || x == z || y == z = 2
| otherwise = 0
modiv :: Int -> Int -> (Int, Int)
modiv x y = (div x y, mod x y)
distancia :: (Float, Float)-> (Float, Float)-> Float
console.log('%c Estamos felizes em te ver por aqui.', 'background: #222; color: #00FF00');
console.log('%c Seja muito bem vindo.', 'background: #222; color: #00FF00');
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 10
$scope.newSession = function(session){
MeuServico.newSession(session).success(function(){
//sucesso
}).error(function(){
//erro
})
}
$scope.submit = function() {
MeuServico.enviaDados($scope.dadosFormulario).then(function(){
//deu certo
},function(){
//erro no servidor
});
};
<ion-header-bar class="">
<h1 class="title">Categorias</h1>
</ion-header-bar>
<ion-content>
<ion-list ng-if="categories">
<ion-item type="item" ng-repeat="category in categories">
{{category}}
</ion-item>