- 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> |
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
#! /bin/bash | |
clear | |
echo -e "#1 - Removing build/ directory for a fresh build of the project..." | |
if [ -d "build/" ]; then | |
rm -rf build/ | |
fi | |
echo -e "\n#2 = Building project..." |
Possible unexpected errors with resolutions:
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://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git | |
# Reset the current branch to the commit just before the last 12: | |
git reset --hard HEAD~12 | |
# HEAD@{1} is where the branch was just before the previous command. | |
# This command sets the state of the index to be as it would just | |
# after a merge from that commit: | |
git merge --squash HEAD@{1} | |
# Commit those squashed changes. The commit message will be helpfully |
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
// Via route property. | |
this.set('route.path', '/the/new/path') | |
// Or to change the full absolute url: | |
window.history.pushState({}, null, '/the/new/absolute/path'); | |
this.fire('location-changed', {node: window}); |
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
d = new Date(); | |
dl = new Date(d.getTime() - d.getTimezoneOffset() * 60 * 1E3); | |
console.log(d); | |
console.log(dl.toISOString()); | |
console.log(d.getTimezoneOffset / -60); |
How to create your own snippet for VS Code - https://code.visualstudio.com/Docs/customization/userdefinedsnippets
How to publish your own snippet for VS Code - https://code.visualstudio.com/docs/tools/vscecli#_publishers-and-personal-access-tokens
- npm install -g vsce
- Create a free account at https://www.visualstudio.com/en-us/get-started/setup/sign-up-for-visual-studio-online
- Create your publisher name - vsce create-publisher (publisher name)
- Create Extension manifest (package.json). More details at https://code.visualstudio.com/docs/extensionAPI/extension-manifest
- vsce publish // OR vsce publish major|minor|patch
- DONE. Your snippet is now up on VS Code's Extensions marketplace.
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); |