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 turn = 0; | |
var teams = ['Rupie', 'TheTeam', 'Veritas', 'ImaginApp', 'Nebuchadnezzar', 'InternalServerError']; | |
var patoTeams = ['YisusPlusOne', 'ZipCity2000', 'tqzptscsaj']; | |
var pedroTeams = ['String.random','ToPa']; | |
var thomasTeams = ['LosExtraterrestresMusicales', 'Rock and Prog', 'PW:Software']; | |
var result = teams.sort(function(){return 0.5 - Math.random();}) | |
.reduce(function(previous, current) { | |
previous[['pato', 'thomas', 'pedro'][turn++ % 3]].push(current); | |
return previous; |
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 print_dates(dates, answer_text) | |
puts "\nAnswers left:" if answer_text | |
puts dates.join("; ") | |
print "\n" | |
end | |
class Day | |
attr_accessor :month, :day | |
def initialize(month, day) | |
@day = day; |
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
<!-- Iterate N times (replace N with a number --> | |
{% for i in "x"|ljust:"N" %} | |
<!-- Access numeric variable (0-based index) --> | |
{{ forloop.counter0 }} | |
<!-- Access numeric variable (1-based index) --> | |
{{ forloop.counter }} | |
{% endfor %} | |
<!-- For example, iterate from 0 to 3 --> |
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 obtener_dv rut | |
rut = rut.to_s.tr(".-", "").reverse | |
suma = 0 | |
for index in 0..rut.size | |
suma+= rut[index].to_i * (2+index%6) | |
end | |
res = 11 - suma % 11 | |
res = (res == 11)? 0 : (res == 10)? "K" : res | |
res.to_s | |
end |
NewerOlder