Skip to content

Instantly share code, notes, and snippets.

View tsevdos's full-sized avatar
🏠
Working from home

John Tsevdos tsevdos

🏠
Working from home
View GitHub Profile
@tsevdos
tsevdos / example.rb
Created September 13, 2015 11:03
Ruby tips : Here Documents
name = 'John'
# default acts as double-quoted string
puts <<heredoc
Hello #{name}
other line 1,
other line 2.
heredoc
# double-quoted string
@tsevdos
tsevdos / example_1.rb
Created September 13, 2015 10:58
Ruby tips : Parallel Assignment of Variables
a, b, c = 50, 'cent', :test
# a => 50
# b => 'cent'
# c => :test
dir($('el'));
console.table(myArray);
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
getEventListeners( $('input') );
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
$$('a') // returns all link elements
document.querySelectorAll('a') // returns all link elements
$$('a') === document.querySelectorAll('a') // true!
$('a') // returns the first link element
document.querySelector('a') // returns the first link element
$('a') === document.querySelector('a') // true!
<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 -->