Skip to content

Instantly share code, notes, and snippets.

Avatar
🤷‍♂️
just writing javascript

Jhon jhonalino

🤷‍♂️
just writing javascript
View GitHub Profile
View dopublic
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDFbcTbSIYZ30FJCw3eXOYFKB9XDy1l9Hv2ETxE7xn+8IHiflLm3DYb0mF0Shhaouj3E6QXIduh9IDhUjt75L1KOp+YF73WMmylm1IBu2ZL+9e76TrUVlZNEqDlCvjugntiyxtUqYpAyPWXVpaRLxsyy07XV6uvjyLEO8EhOb0gCiIoodmmwP5neHslcntFvUGsb0vYNO56kBwFBrEv7x+rRRaV6tRsGSyITkALb55BbwaLWPsyUoa11hU48GGT56ZkKBETxfi5pFY2WUlLoHt+qyty+Bfh+1EVi+y+gIA/rqYhyIJZkyiaJPGHpk+TkYS9sFAsxMRWH6nC9p/JxNYmDOGoapH9hV3tn2JvUwXsORREpfvxYhY1w2CMSUw4/YuAgzZVX7XhcijK68vKwH5RtA3ued75IfBurzxNCh/+WavYFbi0t33qSE3xYgU9QGEjIm5gDFf7PwLZI0Gf4ArKijzWqf6o3mhSGrFa6yPX45MdOQ58QNON5bW4nsbXLLc= jhon@jhon-lenovo
@jhonalino
jhonalino / css_reset
Created Sep 3, 2018
eric meyer css reset
View css_reset
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@jhonalino
jhonalino / .block
Last active Jun 18, 2018
fresh block
View .block
license: mit
View equality_2.js
var val = undefined
if(val === undefined || val === null) {
//do something
}
if(val == undefined) {
//do something
}
View equality_1.js
if(num === 10 || num === "10") {
//do someting
}
if(num == 10) {
//do someting
}
View scope_1.js
function doImportantStuff() {
//function scope
var someVariable = "important stuff";
}
{
//block scope
let anotherVariable = "not so important";
}
View scope_2.js
function doImportantStuff() {
var someVariable = "important stuff";
console.log(someVariable); // "important stuff"
console.log(anotherVariable); // oops can't access that
}
function anotherImportantStuff() {
var anotherVariable = "not so important";
}
View lexical_scope.js
function doImportantStuff() {
var someVariable = "important stuff";
function reportImportantStuff() {
console.log(someVariable) // "important stuff"
}
reportImportantStuff();
}
@jhonalino
jhonalino / README.md
Created May 2, 2018 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
View rootjs_homework
for( var x=0; x<3; x++){
for( var y=3; y>0; y--){
console.log( y*x);
}
}
//initiate x with 0
//check x < 3 if we can proceed
//if so, do the inner loop
//initiate y to 3
//check y > 0 if we can proceed