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
puts 'OI? EU ESTOU FICANDO SURDA.. POR FAVOR FALE ALTO..' | |
tchau = 0 | |
while(r = gets.chomp) | |
# verifica se o usuário digitou em caps lock, caso contrário a variável tchau é zerada | |
if (r == r.upcase) | |
# adiciona +1 a variável tchau, caso o usuário tenha dito TCHAU | |
if (r == 'TCHAU') | |
tchau += 1 | |
else |
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 loop | |
i = 0 | |
while(i < 10) | |
i += 1 | |
puts i | |
end | |
end | |
# agora é possível chamar o loop quantas vezes quiser | |
loop |
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
puts "Ola!" | |
puts "Vamos calcular?" | |
puts "Coloque uma valor para a em ax2+bx+c=0, sendo a diferente de 0." | |
a = gets.chomp.to_f | |
puts "Agora, coloque uma valor para b em ax2+bx+c=0." | |
b = gets.chomp.to_f | |
puts "Agora, para finalizar, coloque uma valor para c em ax2+bx+c=0." | |
c = gets.chomp.to_f | |
x = (b*b) - (4*a*c) | |
puts '' |
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
-javascript 'post' | |
= simple_form_for(@post) do |f| | |
= render 'shared/error_messages', :target => @post | |
.inputs | |
= f.input :title | |
= f.input :sequence | |
= f.input :description, :input_html => {:rows =>5} | |
= f.simple_fields_for :sections do |section_f| |
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
(defparameter *num-players* 2) | |
(defparameter *max-dice* 3) | |
(defparameter *board-size* 2) | |
(defparameter *board-hexnum* (* *board-size* *board-size*)) | |
(defun board-array (lst) | |
(make-array *board-hexnum* :initial-contents lst)) | |
(defun gen-board () | |
(board-array (loop for n below *board-hexnum* |
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
# ----------------- | |
# User Instructions | |
# | |
# Write a function, extend_prefix, nested in find_words, | |
# that checks to see if the prefix is in WORDS and | |
# adds that to results if it is. | |
# | |
# If not, your function should check to see if the prefix | |
# is in PREFIXES, and if it is should recursively add letters | |
# until the prefix is no longer valid. |
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
import urllib | |
import urllib2 | |
from bs4 import BeautifulSoup | |
import re | |
import time | |
# expressao regular pra remover a sujeira do campo da linha de onibus | |
linha_r = re.compile('[\t\n\r\-\|]+') | |
url = "http://www.pmf.sc.gov.br/servicos/index.php?pagina=onibus" |
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
GIT | |
remote: git://github.com/pilu/web-app-theme.git | |
revision: b7310fe5001ed03b965049f293fce3527ae98dae | |
specs: | |
web-app-theme (0.8.0) | |
rails (~> 3.2.0) | |
thor (~> 0.14) | |
PATH | |
remote: vendor/gems/acts-as-taggable-on-2.3.3 |
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
(define-route main ("" :method :get) | |
(with-html-output-to-string (out) | |
(:html | |
(:body | |
(:h1 (princ-safe "Le Reader")))))) |
OlderNewer