I hereby claim:
- I am dylanerichards on github.
- I am dylanerichards (https://keybase.io/dylanerichards) on keybase.
- I have a public key ASCe5ovvtncj3b6yQevyKLq2erkT6cm35ZiARvm36wPA8Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def trapped_rain(data) | |
[].tap { |total_rain| data.each_with_index { |datum, index| total_rain << [data[0..index].max, data[index..-1].max].min - datum} }.inject(&:+) | |
end | |
trapped_rain(rainfall) |
in application.html.erb | |
<html ng-app="app"> | |
<div ng-controller="moneyCtrl"> | |
<input type="text" ng-model="test" format="number"/> | |
</div> |
var header = document.getElementById("header") | |
var button = document.getElementById("login-button") | |
button.addEventListener("click", function() { | |
validateForm() | |
}) | |
function validateForm() { | |
if(checkPassword() == true && checkUsername() == true) { |
def find(id) | |
cmd = `sqlite3 test "select * from things where id = #{id}"` | |
end | |
def all | |
users_array = [] | |
users = `sqlite3 test "select * from things;"`.split("\n") | |
users.each { |user| users_array << user } |
function stringy(num) { | |
var result = [1]; | |
if (num == 1) { return result; }; | |
for(i = 0; i < num; i++) { | |
var lastElement = result[result.length - 1]; | |
lastElement == 0 ? result.push(1) : result.push(0); | |
} |
➜ new-repository git init | |
Initialized empty Git repository in /Users/dylanrichards/code/new-repository/.git/ | |
➜ new-repository git:(master) touch index.html | |
➜ new-repository git:(master) ✗ gd | |
➜ new-repository git:(master) ✗ gaa | |
On branch master | |
Initial commit | |
Changes to be committed: |
class WakaWaka | |
attr_reader :code | |
def initialize(code) | |
@code = code | |
end | |
MAPPINGS = { | |
'<' => 'Waka', | |
'>' => 'waka', |
class NumberGuessingGame | |
def initialize | |
p @number = rand(0..9).to_s | |
end | |
def guess | |
puts "I'm thinking of a random number from 0 to 9" | |
puts "Can you guess it?" | |
input = gets.chomp |
board_string = "003020600900305001001806400008102900700000008006708200002609500800203009005010300" | |
class Sudoku | |
attr_accessor :board | |
def initialize(string) | |
@board = string | |
end | |
def rows |