Service | SSL | status | Response Type | Allowed methods | Allowed headers |
---|
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> | |
<script src="url.js"></script> | |
<script> | |
var url = new URL('http://www.example.com/a/b/c.html?p=q&r=s&p&p=t#hash'); | |
for (var key in url) { | |
console.log(key, url[key]); | |
} |
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
// We allocate a file with the size of the downloaded file so we can | |
// append chunks randomly to diffrent position as we download the file | |
function allocateDisk(size, callback){ | |
fss.cwd.getFile(prompt("Filename","movie.mp4"), {create: true}, (fileEntry) => { | |
fileEntry.createWriter((writer) => { | |
var blob = new Blob([new ArrayBuffer(1.049e+8)]) | |
writer.onerror = (err) => { |
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
// based on this https://github.com/davidbau/seedrandom#other-fast-prng-algorithms but without `next()` | |
(b,c,d,f,g,h,k,s=1,t=4022871197)=>(k=u=>{for(d of u)t+=d.charCodeAt(0),f=.02519603282416938*t,t=f>>>0,f-=t,f*=t,t=f>>>0,f-=t,t+=4294967296*f;return 2.3283064365386963e-10*(t>>>0)},c=k(' '),g=k(' '),h=k(' '),c-=k(b),0>c&&(c+=1),g-=k(b),0>g&&(g+=1),h-=k(b),0>h&&(h+=1),b=2091639*c+2.3283064365386963e-10*s,h=b-(0|b)) | |
// usage | |
// const randomizer = <code> | |
// const seed = '2' // must be string | |
// randomizer(seed); // 0.4575677579268813 |
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 pc1 = new RTCPeerConnection(), | |
pc2 = new RTCPeerConnection(); | |
var addCandidate = (pc, can) => can && pc.addIceCandidate(can).catch(console.error); | |
pc1.onicecandidate = e => { addCandidate(pc2, e.candidate); }; | |
pc2.onicecandidate = e => { addCandidate(pc1, e.candidate); }; | |
pc1.oniceconnectionstatechange = e => console.log("pc1 iceConnState:", pc1.iceConnectionState); | |
pc2.oniceconnectionstatechange = e => console.log("pc2 iceConnState:", pc2.iceConnectionState); |
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
import { compress, decompress } from 'zlib.js' | |
compr = await compress('hhhhheeeej'.repeat(200)).blob() | |
blob = await decompress(compr).blob() |
- ⎋ (escape):
U+238B
- ⇥ (tab):
U+21E5
- ⇪ (caps lock):
U+21EA
- ⇧ (shift):
U+21E7
- ⌃ (control):
U+2303
- ⌥ (option):
U+2325
- (Apple):
U+F8FF
(in some Apple-provided fonts only) - ⌘ (command):
U+2318
␣ (space):
U+2423
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 blob = new Blob(['123']) | |
const xhr = new XMLHttpRequest() | |
const url = URL.createObjectURL(blob) | |
// required if you need to read binary data: | |
xhr.overrideMimeType('text/plain; charset=x-user-defined') | |
xhr.open('GET', url, false) | |
xhr.send() | |
const uint8 = Uint8Array.from(xhr.response, c => c.charCodeAt(0)) |
OlderNewer