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
export const HISTORY_STATE_CHANGE_EVENT = 'historystatechange'; | |
history.pushState = changeState(history.pushState) | |
history.replaceState = changeState(history.replaceState) | |
window.addEventListener('popstate', fireStateChange) | |
setTimeout(fireStateChange); | |
function changeState(orig) { | |
return (...args) => { |
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
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |
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
/** | |
* @category Common Helpers | |
* @summary Convert the given argument to an instance of Date. | |
* | |
* @description | |
* Convert the given argument to an instance of Date. | |
* | |
* If the argument is an instance of Date, the function returns its clone. | |
* | |
* If the argument is a number, it is treated as a timestamp. |
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
{ | |
"ensure_newline_at_eof_on_save": false, | |
"font_size": 13, | |
"ignored_packages": | |
[ | |
], | |
"rulers": | |
[ | |
100 | |
], |
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
fetch('/api/things') | |
.then(res => res.json()) | |
.then(res => console.log(res)) |
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
/** Aborting $http made simple */ | |
export class AbortableHttpService { | |
constructor($q, $http, $timeout) { | |
this.$q = $q; | |
this.$timeout = $timeout; | |
this.$http = $http; | |
} | |
get(url, options = {}) { | |
const {$q, $http, $timeout} = this; |
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><meta charset=utf-8><title>Hello World!</title> |
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
Object.getPrototypeOf(customElements.get('my-custom-element')).name | |
// "HTMLElement" |
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 tagName = 'demo-app'; | |
const template = document.createElement('template'); | |
template.innerHTML = ` | |
<style> | |
:host { | |
display: block; | |
contain: content; | |
} | |
:host([hidden]) { |
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><meta charset=utf-8><title>Demo</title> | |
<link rel=stylesheet href=component.css> | |
<component></component> | |
<script src=https://ajax.googleapis.com/ajax/libs/angularjs/1.7.6/angular.min.js></script> | |
<script>angular.module('componentModule', [])</script> | |
<script src=component.js></script> | |
<script>angular.bootstrap(document.documentElement, ['componentModule'])</script> |
OlderNewer