| Internet Explorer | Microsoft Edge | Mozilla Firefox |
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
var foundCustomElements = []; | |
var foundCustomElementNames = []; | |
// main function to deeply find all custom elements on a page. | |
function getAllCustomElements(nodes) { | |
nodes.forEach(el => { | |
if (el.shadowRoot) getAllCustomElements(node.shadowRoot.querySelectorAll('*')); | |
if (el.localName.includes('-') || el.getAttribute('is') && el.getAttribute('is').includes('-')) { | |
foundCustomElements.push(el); |
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
// ES2015 module's export. | |
// utility.js | |
function generateRandom() { return Math.random(); } | |
function sum(a, b) { return a + b; } | |
export { generateRandom, sum }; | |
// ES2015 module's import with export. | |
import { generateRandom, sum, default as haha } from './utility'; | |
import * as utils from './utility'; |
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; | |
} |
- Everything will be installed here:
C:\Users\<user_profile_name>\.babun\cygwin\home\<user_profile_name>
. - Head over to Cobalt2 theme on
oh-my-zsh
in a mintty environment to install Cobalt2 theme. - That's it. Enjoy~
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
// Strict escaping symbols not accepting by Firebase. | |
// https://www.firebase.com/docs/web/guide/understanding-data.html#section-creating-references | |
// Data Limits - A child node's key cannot be longer than 768 bytes, nor deeper than 32 levels. | |
// It can include any unicode characters except for . $ # [ ] / and ASCII control characters 0-31 and 127. | |
function encodeURIComponentForFirebase(str) { | |
return encodeURIComponent(str).replace(/[\.\#\$\[\]]/g, function (c) { | |
return '%' + c.charCodeAt(0).toString(16); | |
}); | |
}, |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<base href="https://polygit2.appspot.com/components/"> | |
<script src="webcomponentsjs/webcomponents-lite.min.js"></script> | |
<script> |