I hereby claim:
- I am charmainetham on github.
- I am charmainetham (https://keybase.io/charmainetham) on keybase.
- I have a public key whose fingerprint is 91FA CA93 B948 9B0B 5726 3852 ADC3 BEC5 1663 209E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<form> | |
First name:<br> | |
<input type="text" name="firstname"><br> | |
Last name:<br> | |
<input type="text" name="lastname"> | |
</form> |
function arrayOfLight(n){ | |
var arr =[] | |
for(var i = 0; i <= n; i ++){ | |
arr.push(i) | |
}; | |
return arr | |
}; | |
arrayOfLight(5) |
//Why is this broken? | |
var mySuperAwesomeVariableName = "Ted Mosby"; | |
mySuperAwesomeVariableName = "BATMAN!"; | |
console.log(mySuperAwesomeVariableName); | |
//line breaks are interpreted as line-ending semicolons. | |
//Even in a string,if you include a hard line break in between quotes you’ll get a parse error (unterminated string). | |
//backslashes are the way to go |
#NUMBER 1 | |
SELECT e.isbn FROM editions AS e | |
JOIN publishers AS p ON e.publisher_id = p.id | |
WHERE p.name = 'Random House'; | |
#NUMBER 2 NUMBER 3 NUMBER 4, NUMBER 5 | |
SELECT b.title, e.isbn, s.stock, s.retail, |
def benchmark | |
starting_time = Time.now | |
yield | |
end_time = Time.now | |
end_time - starting_time | |
end | |
# Be careful, pasting this into IRB will take a long time to print. | |
# It's a loooong string. :) | |
long_string = "apple"*100000000 |
# 2 empty empty bottles you get one free bottle | |
# for every 4 bottle caps you get one free bottle | |
# each bottle cost $2 | |
def calculate(number) | |
empty_bottles(number) + bottle_caps(number) | |
end | |
def bottles_from_cash(cashtobottles) | |
@no_of_bottles = cashtobottles/2 |
require 'active_support/all' | |
@candidates = [ | |
{ | |
id: 5, | |
years_of_experience: 4, | |
github_points: 293, | |
languages: ['C', 'Ruby', 'Python', 'Clojure'], | |
date_applied: 5.days.ago.to_date, | |
age: 26 |
# Determine whether a string contains a SIN (Social Insurance Number). | |
# A SIN is 9 digits and we are assuming that they must have dashes in them | |
def has_sin?(string) | |
if /\W\d{3}-\d{3}-\d{3}$/.match string | |
return false | |
else | |
return true | |
end | |
end |
@nums = { "M"=>1000, "D"=>500, "C"=>100, "L"=>50, "X" =>10, "V" =>5, "I" =>1} | |
def to_roman(number) | |
roman = "" | |
@nums.each do |rom,num| | |
while number >= num | |
roman << rom | |
number -= num # TODO update number to take remainder | |
end |