- Library Genesis - http://gen.lib.rus.ec/
- Traversy Media - https://www.youtube.com/channel/UC29ju8bIPH5as8OGnQzwJyA
- Udemy -
// exemple based on https://github.com/diafygi/webcrypto-examples#rsa-oaep | |
function importKey() { | |
return window.crypto.subtle.importKey( | |
"jwk", //can be "jwk" or "raw" | |
{ //this is an example jwk key, "raw" would be an ArrayBuffer | |
kty: "oct", | |
k: "Y0zt37HgOx-BY7SQjYVmrqhPkO44Ii2Jcb9yydUDPfE", | |
alg: "A256GCM", | |
ext: true, |
// Here is a proposal for minimalist JavaScript classes, humbly offered. | |
// There are (at least) two different directions in which classes can be steered. | |
// If we go for a wholly new semantics and implementation, then fancier classical | |
// inheritance can be supported with parallel prototype chains for true inheritance | |
// of properties at both the class and instance level. | |
// If however, we keep current JavaScript prototype semantics, and add a form that | |
// can desugar to ES3, things must necessarily stay simpler. This is the direction | |
// I'm assuming here. |
// A response to jashkenas's fine proposal for minimalist JavaScript classes. | |
// Harmony always stipulated classes as sugar, so indeed we are keeping current | |
// JavaScript prototype semantics, and classes would only add a syntactic form | |
// that can desugar to ES5. This is mostly the same assumption that Jeremy | |
// chose, but I've stipulated ES5 and used a few accepted ES.next extensions. | |
// Where I part company is on reusing the object literal. It is not the syntax | |
// most classy programmers expect, coming from other languages. It has annoying | |
// and alien overhead, namely colons and commas. For JS community members who |
//You shouldn't find your self asking for ids from a Falcor JSON Graph object. | |
//it seems like you want to build an array of game ids: | |
{ | |
games: [ | |
{ $type: "ref", value: ["gamesById", 352] }, | |
{ $type: "ref", value: ["gamesById", 428] } | |
// ... | |
], |
JSON_text | |
= ws value:value ws { return value; } | |
begin_array = ws "[" ws | |
begin_object = ws "{" ws | |
end_array = ws "]" ws | |
end_object = ws "}" ws | |
name_separator = ws ":" ws | |
value_separator = ws "," ws |
function Observable(subscribe) { | |
this._subscribe = subscribe; | |
} | |
const of = (v) => new Observable(observer => { | |
return observer.next(v); | |
}); | |
Observable.prototype = { | |
map(f) { |
js> b = new ArrayBuffer(64) | |
({}) | |
js> a = new Uint32Array(b) | |
({0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0}) | |
js> a[0] | |
0 | |
js> a[0] = Math.pow(2,32) | |
4294967296 | |
js> a[0] | |
0 |
// XXX should be standard (and named clone, after Java?) | |
Object.prototype.copy = function () { | |
let o = {} | |
for (let i in this) | |
o[i] = this[i] | |
return o | |
} | |
// Containment testing for arrays and strings that should be coherent with their iterator. | |
Array.prototype.contains = String.prototype.contains = function (e) { |