Skip to content

Instantly share code, notes, and snippets.

View jhonalino's full-sized avatar
🤷‍♂️
just writing javascript

Jhon (kiko) jhonalino

🤷‍♂️
just writing javascript
View GitHub Profile
@jhonalino
jhonalino / index.css
Created April 26, 2018 06:48
system fonts for web
body {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans,
Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}
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
@jhonalino
jhonalino / README.md
Created May 2, 2018 23:13 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
function doImportantStuff() {
var someVariable = "important stuff";
function reportImportantStuff() {
console.log(someVariable) // "important stuff"
}
reportImportantStuff();
}
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";
}
function doImportantStuff() {
//function scope
var someVariable = "important stuff";
}
{
//block scope
let anotherVariable = "not so important";
}
if(num === 10 || num === "10") {
//do someting
}
if(num == 10) {
//do someting
}
var val = undefined
if(val === undefined || val === null) {
//do something
}
if(val == undefined) {
//do something
}
@jhonalino
jhonalino / .block
Last active June 18, 2018 04:49
fresh block
license: mit
@jhonalino
jhonalino / css_reset
Created September 3, 2018 00:02
eric meyer 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,