| Internet Explorer | Microsoft Edge | Mozilla Firefox | Google Chrome | ![O
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
'use strict'; | |
// Process flow: gulp backup --> gulp build --> gulp revert (optional) | |
// Folder structure in order to make this works: | |
// |- my-element-icons.html // extracted icons, if any. | |
// |- my-element.theme.html // external CSS file. | |
// |- my-element.html // main html. | |
// '- my-element.js // load JS file externally. | |
const fs = require('fs'); | |
const gulp = require('gulp'); |
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://github.com/robbyrussell/oh-my-zsh | |
// https://github.com/wesbos/Cobalt2-iterm |
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://help.github.com/articles/configuring-a-remote-for-a-fork/ | |
// https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches | |
// List current configured remote repo for your fork. | |
git remote -v | |
// Specify a new remote upstream repo. | |
git remote add upstream <GITHUB_REPO_URL> | |
// https://help.github.com/articles/syncing-a-fork/ |
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
const a = document.createElement('div'); | |
document.body.appendChild(a); | |
const b = document.createElement('template'); | |
b.innerHTML = ` | |
<style> | |
:host { display: block; box-sizing: border-box; } | |
.container { background-color: var(--fancy-bg, red); | |
@media (min-width: 768px) { |
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
_trapFocusWithinModal (ev, focusableNodes, callback) { | |
const _kc = ev.keyCode; | |
if (ev.type === 'keydown' && _kc === TAB_KEY) { | |
console.log('keyboard tab on:', ev.target, focusableNodes); | |
// Prevent default TAB operation. | |
ev.preventDefault(); | |
const _maxAllowableFocusableNodesLength = focusableNodes.length - 1; |
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
// To init. | |
gcloud init | |
// To list all the compute instances. | |
gcloud compute instances list | |
// gcloud compute instances list | grep <instance_name> | |
// To ssh the instance. | |
gcloud compute ssh <machine_name>@<instance_name> |
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
// http://superuser.com/questions/602385/find-and-delete-all-the-directories-named-test-in-linux | |
// find <directory_location> -name <regex_of_file_or_directory> -type <type> -exec <command>; | |
find . -name bower_components -type d -exec rm -rf {} \; |
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
brew install node --with-intl=full-icu --download-all | |
// To reinstall with all locales. | |
brew reinstall node --with-full-icu |
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
// Generate random number between 0 and <maxNumber> inclusive. | |
function randomWithRange(minNumber, maxNumber) { | |
var _minNumber = minNumber || 0; | |
var _maxNumber = (maxNumber || 1) * 10 + 1 - _minNumber; | |
var _random = _minNumber + Math.floor(Math.random() * _maxNumber) / 10; | |
return randomWithRange; | |
} |