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 cacheName = 'my-cache-1' | |
self.addEventListener('install', event => { | |
console.log('install') | |
}); | |
self.addEventListener('activate', event => { | |
console.log('activate') | |
event.waitUntil(self.clients.claim()) | |
}); |
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
/* @flow */ | |
declare class CacheOptions { | |
ignoreSearch: ?bool; | |
ignoreMethod: ?bool; | |
ignoreVary: ?bool; | |
cacheName: ?bool; | |
} | |
declare interface Cache { | |
add(url: string): Promise<void>; | |
addAll(urls: [Request | string]): Promise<void>; |
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 lang=en-GB> | |
<head> | |
<meta charset='utf-8'> | |
<title>The Air Horner</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1'> | |
</head> | |
<body> | |
<iframe style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; width:100%; height: 100%" | |
src="http://tv-app-web-map.herokuapp.com/" |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script> | |
<form method="POST" enctype="multipart/form-data" action="https://www.google.com/save" id="myForm"> | |
<input type="hidden" name="img_val" id="img_val" value="" /> | |
</form> | |
<div id="more"> | |
<h1 style='color: red'> hello </h1> | |
<iframe src="https://tags.mli.me/12751"> | |
</iframe> |
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
class Callback { | |
constructor(f) { | |
// this.run = f | |
this.run = callback => { | |
try { | |
f(callback) | |
} catch (ex) { | |
callback(ex, null) | |
} |
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> | |
<meta charset="utf-8"> | |
<title>SANKEY Experiment</title> | |
<style> | |
.node rect { | |
cursor: move; | |
fill-opacity: .9; | |
shape-rendering: crispEdges; | |
} |
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
class Kleisli { | |
// given f :: x -> Monad y, constructs a category of type: | |
// Cat (x ↣ y) | |
constructor(f) { | |
// this.run = f | |
this.run = x => f(x) | |
// this :: Cat (x ↣ y) |
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
class Func { | |
constructor(f) { | |
// this.run = f | |
this.run = x => f(x) | |
// this :: Cat (x ↣ y) | |
// Cat (y ↣ z) -> Cat (x ↣ z) | |
this.pipe = g => new Func(x => g.run(this.run(x))) | |
// utility function that pipes Func to a normal function |
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
class Callback { | |
constructor(f) { | |
// this.run = f | |
this.run = callback => { | |
try { | |
f(callback) | |
} catch (ex) { | |
callback(ex, null) | |
} |
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
class Callback { | |
constructor(f) { | |
this.run = (...args) => { | |
f(...args) | |
} | |
this.map = g => new Callback((...args) => { | |
const nArgs = R.init(args) | |
const callback = R.last(args) | |