Perform this workout on Fitloop: Android App | iPhone App
- Make sure your diet is in check.
- Check What routine should I do? to make sure this routine is right for you.
- See also: Learn how to make quality goals.
import random | |
import time | |
DEAD = 0 | |
LIVE = 1 | |
def dead_state(width, height): | |
"""Constuct an empty state with all cells set to DEAD. | |
Parameters |
This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.
If you are using the Circle CI 2.0, take a look at this article from ryansimms
On Project Settings > Environment Variables add this keys:
jQuery(document).ready(function($) { | |
$.validator.setDefaults({ | |
errorClass: 'errorField', | |
errorElement: 'div', | |
errorPlacement: function(error, element) { | |
error.addClass("ui red pointing above ui label error").appendTo( element.closest('div.field') ); | |
}, | |
highlight: function(element, errorClass, validClass) { | |
$(element).closest("div.field").addClass("error").removeClass("success"); | |
}, |
class Luhn | |
def self.checksum(number) | |
digits = number.to_s.reverse.scan(/\d/).map { |x| x.to_i } | |
digits = digits.each_with_index.map { |d, i| | |
d *= 2 if i.even? | |
d > 9 ? d - 9 : d | |
} | |
sum = digits.inject(0) { |m, x| m + x } | |
mod = 10 - sum % 10 | |
mod==10 ? 0 : mod |