class StockTicker extends HTMLElement {
createdCallback() {
this.createShadowRoor().innerHTML = `
<style> :host { display: block; } </style>
<div id="quotes"></div>`;
}
updateQuotes() {
let url = `https://api.finance.com?q=${this.symbols}`;
This file contains hidden or 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 DB_VERSION = 1; // Use a long long for this value (don't use a float) | |
const DB_STORE_NAME = 'customer'; | |
const DB_NAME = 'default'; | |
class Database { | |
constructor(name = 'default', version = 1) { | |
this.name = name; | |
this.version = version; | |
} |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
window.onload = function () { | |
@foreach($tables as $table => $columns) | |
var chart = new CanvasJS.Chart("{{$table}}", | |
{ | |
theme: "theme3", |
This file contains hidden or 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
.PHONY: ansible | |
ansible: | |
command -v ansible || make ${HOME}/workspace/src/github.com/ansible/ansible/build | |
.PHONY: ansible-build-dependencies | |
ansible-build-dependencies: enable-epel | |
yum update \ | |
&& yum -y groupinstall "Development tools" \ | |
&& yum -y install python-{pip,setuptools,devel} |
- HTTPS Required - Service Workers are restricted to running across HTTPS for security reasons.
- Same Origin Required - Service workers must be from the same domain as for the page/app they are registered.
- Beware Global Variables - A single service worker can control many pages. Each time a page within your scope is loaded, the service worker is installed against that page and operates on it. Bear in mind therefore that you need to be careful with global variables in the service worker script: each page doesn’t get its own unique worker.
Service worker functions like a proxy server, allowing you to modify requests and responses, replace them with items from its own cache, and more.
Events
The following is from scotthelme.co.uk
with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy), you can tell the browser that it can only download content from the domains you explicitly allow http://www.html5rocks.com/en/tutorials/security/content-security-policy/ https://www.owasp.org/index.php/Content_Security_Policy I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'
This file contains hidden or 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
Show hidden characters
{ | |
"preset": "google", | |
"jsDoc": { | |
"checkAnnotations": "jsdoc3", | |
"checkParamExistence": true, | |
"checkParamNames": true, | |
"requireParamTypes": true, | |
"checkRedundantParams": true, | |
"checkReturnTypes": true, | |
"checkRedundantReturns": true, |
This file contains hidden or 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://www.thedotpost.com/2015/11/francesc-campoy-flores-functional-go | |
-- https://youtu.be/ouyHp2nJl0I?t=85 | |
quicksort [] = [] | |
quicksort (x:xs) = | |
let smaller = quicksort [a | a <- xs, a <= x] | |
bigger = quicksort [a | a <- xs, a > x] | |
in smaller ++ [x] ++ bigger |
This file contains hidden or 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
# find ./ -type f -exec ldd {} \; 2>/dev/null | less | |
# LOCAL is the path prefix where the programs will be installed | |
# The environment variable will supersede the default value | |
#LOCAL ?= ${HOME}/local | |
SRC = ${CURDIR} | |
BIN = ${LOCAL}/bin | |
ifndef LOCAL | |
$(error LOCAL is not set) | |
endif |
This file contains hidden or 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://danielmiessler.com/blog/the-one-line-cli-bandwidth-test/ | |
alias bt="wget http://cachefly.cachefly.net/100mb.test -O /dev/null" | |
# Watch nginx logs | |
alias access='tail -f /var/log/nginx/access.log' | |
alias error='tail -f /var/log/nginx/error.log' | |
# column is used here to display a Tab Separated Values file with vertically aligned columns | |
# less is used so the arrow keys can be used to scroll up/down left/right | |
tsv() { |