This file contains 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
name = 'John' | |
# default acts as double-quoted string | |
puts <<heredoc | |
Hello #{name} | |
other line 1, | |
other line 2. | |
heredoc | |
# double-quoted string |
This file contains 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
a, b, c = 50, 'cent', :test | |
# a => 50 | |
# b => 'cent' | |
# c => :test |
This file contains 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
dir($('el')); |
This file contains 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
console.table(myArray); |
This file contains 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
monitorEvents( $('input') ); // Logs ALL the events | |
monitorEvents( $('input') , 'click' ); // Logs only click events | |
monitorEvents( $('input') , ['click' , 'blur' ] ); // Logs only click and blur events | |
unmonitorEvents( $('input') ); // Stop loging the events of the specific element |
This file contains 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
getEventListeners( $('input') ); |
This file contains 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
console.log('Window : ' + window ) // Window : [object Window] | |
console.log('Window : ', window ) // logs correctly the Window object | |
console.log('Window : ', window , 'Object : ', object) // logs everything as expected |
This file contains 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
$$('a') // returns all link elements | |
document.querySelectorAll('a') // returns all link elements | |
$$('a') === document.querySelectorAll('a') // true! |
This file contains 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
$('a') // returns the first link element | |
document.querySelector('a') // returns the first link element | |
$('a') === document.querySelector('a') // true! |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="yes" name="apple-mobile-web-app-capable"> | |
<title>Cool web-app</title> | |
<!-- iPhone - iPod touch - 320x460 --> | |
<link href="splashscreen.png" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image"> | |
<!-- iPhone - iPod (Retina) - 640x920 --> |