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
if 2 + 2 == 4 | |
alert “Correct!” | |
end |
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
if x > 4 | |
if x < 6 | |
alert "Correct!" | |
end | |
elsif x == 4 | |
alert "Correct!" | |
end |
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
class Person | |
attr_reader :name, :age | |
def initialize(name, age) | |
@name = name | |
@age = age | |
end | |
def jump | |
puts "jumping!" |
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
class Person | |
attr_reader :name, :age | |
def initialize(name, age) | |
@name = name | |
@age = age | |
end | |
end |
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
// javascript | |
var person = { | |
name: 'Bob', | |
email: '[email protected]', | |
weight: 160, | |
children: ["Sarah", "Paul"] | |
} |
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
User.where(name: 'Ryan', created_at: 7.days.ago..Time.now) |
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
SELECT * from users where name LIKE 'Ryan%' AND CREATED_AT BETWEEN '2017-08-07' | |
AND '2017-08-15' order by id; |
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
User.all |
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
SELECT * from users; |
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
<script> | |
function goFomo() { | |
// return early if inputs invalid | |
var first_name = jQuery('input[name="edd_first"]').val(); | |
var email = jQuery('input[name="edd_email"]').val(); | |
var products = jQuery('span.edd_checkout_cart_item_title'); | |
var title = jQuery(products[0]).text(); | |
var images = jQuery('.edd_cart_item_image'); |