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
gfdgdf dfgdfg dfg dfgdf |
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
function parseJwt (token) { | |
var base64Url = token.split('.')[1]; | |
var base64 = base64Url.replace('-', '+').replace('_', '/'); | |
return JSON.parse(window.atob(base64)); | |
}; |
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
const Utils = { | |
// -------------------------------- | |
// Parse a url and break it into resource, id and verb | |
// -------------------------------- | |
parseRequestURL : () => { | |
let url = location.hash.slice(1).toLowerCase() || '/'; | |
let r = url.split("/") | |
let request = { | |
resource : null, |
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
/* 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, |
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
<?php | |
/** | |
* Model base class | |
*/ | |
require_once 'connection.php'; | |
class Model { |
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
var data = [ | |
{ | |
country: 'China', | |
population: 1409517397, | |
}, | |
{ | |
country: 'India', | |
population: 1339180127, | |
}, | |
{ |
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
var numbers = [5, 10, 15, 20, 25, 30]; | |
var sum = numbers.reduce(function(total, amount){ | |
return total + amount | |
}); | |
return sum; | |
//Output: 105 |
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
const _err = function(message) { | |
throw new Error(message); | |
} | |
const getSum = (a = _err('a is not defined'), b = _err('b is not defined')) => a + b; | |
getSum(10); // throws Error b is not defined |
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
// https://dev.to/avraammavridis/codetip---javascript-remove-argument-order-dependency-and-provide-defaults-hph | |
// https://codepen.io/alva85/pen/KGYOgM | |
class Vehicle1 { | |
constructor(speed, weight, power, color, brand){ | |
this.speed = speed; | |
this.weight = weight; | |
this.power = power; | |
this.color = color; | |
this.brand = brand; |
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
//https://dev.to/mahlongumbs/if-if-what-1jda | |
const wow = arg => ( | |
(arg === "dog" && "LOVELY") || | |
(arg === "cat" && "CUTE") || | |
"gimme an animal" | |
); | |
wow("cat"); | |
const animals = { |
OlderNewer