Skip to content

Instantly share code, notes, and snippets.

@ryanckulp
ryanckulp / algebra.rb
Created January 1, 2018 21:24
algebra and Ruby
2 + 2 == x
# what is x?
@ryanckulp
ryanckulp / if_x.rb
Created January 1, 2018 21:23
if X example in Ruby
if 2 + 2 == x
alert "Correct!"
end
@ryanckulp
ryanckulp / if.rb
Created January 1, 2018 21:23
if example in Ruby
if 2 + 2 == 4
alert “Correct!”
end
@ryanckulp
ryanckulp / elsif.rb
Created January 1, 2018 20:48
elsif example in Ruby
if x > 4
if x < 6
alert "Correct!"
end
elsif x == 4
alert "Correct!"
end
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
def jump
puts "jumping!"
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
// javascript
var person = {
name: 'Bob',
email: '[email protected]',
weight: 160,
children: ["Sarah", "Paul"]
}
User.where(name: 'Ryan', created_at: 7.days.ago..Time.now)
SELECT * from users where name LIKE 'Ryan%' AND CREATED_AT BETWEEN '2017-08-07'
AND '2017-08-15' order by id;