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
function loadStylesheet(src) { | |
if (document.createStylesheet) { | |
document.createStylesheet(src); | |
} else { | |
const linkTag = document.createElement('link'); | |
linkTag.rel = "stylesheet"; | |
linkTag.type = "text/css"; | |
linkTag.href = src; | |
document.getElementsByTagName('head')[0].appendChild(linkTag); | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Responsive iFrame</title> | |
<style> | |
.resp-iframe {} | |
.resp-iframe__container { | |
position: relative; | |
overflow: hidden; | |
padding-top: 56.25%; // video ratio 9 / 16 = 0.5625 ~ 56.25% change this according video ratio |
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
function telephoneCheck(strPhoneNumber) { | |
let phonePattern = /^\d{10}$|^(1{1}[ ]?)?((\(\d{3}\) ?)|(\d{3}))[- ]?\d{3}[- ]\d{4}$/; | |
return phonePattern.test(strPhoneNumber); | |
} | |
// telephoneCheck("555-555-5555"); // --> 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
.diagonal-stripe { | |
background: repeating-linear-gradient( | |
45deg, | |
yellow 0px, | |
yellow 40px, | |
black 40px, | |
black 80px | |
); | |
} |
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": "basic-webpack-scss", | |
"version": "1.0.0", | |
"description": "Minimum Webpack SCSS for development", | |
"main": "", | |
"scripts": { | |
"build": "webpack --watch", | |
"start": "webpack-dev-server --open" | |
}, | |
"author": "Herwindo Artono", |
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": "basic-webpack-config-windo", | |
"sideEffects": [ | |
"*.css" | |
], | |
"version": "0.0.1", | |
"description": "", | |
"private": true, | |
"main": "index.js", | |
"scripts": { |
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
# https://stackoverflow.com/questions/40505481/error-when-launching-rethinkdb-restore-no-such-file-or-director/51242048#51242048 | |
python -mrethinkdb._restore #FILE |
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
/** | |
* addItem | |
* adding item into existing array by matching id | |
*/ | |
function addItem(item, currentArrayOfItem) { | |
let exist = currentArrayOfItem.find(_item => _item.id === item.id); | |
if (exist) { | |
let index = currentArrayOfItem.indexOf(exist); | |
currentArrayOfItem.splice(index, 1, item); // reason: reactivity | |
} else { |
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
function checkStringIsXML(data) { | |
var matcher = new RegExp('<?xml'); | |
return data.match(matcher) ? true : false; | |
} |
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
/** | |
* msNow | |
* UNIX timestamp in javascript | |
*/ | |
function msNow(): number { | |
return (new Date()).getTime(); | |
} |
NewerOlder