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
wasm-pack does a bit more than just build (npm stuff), but that's really all most people care about (myself included). The relevant pieces can be traced from the build command: | |
https://github.com/rustwasm/wasm-pack/blob/master/src/command/build.rs#L264 | |
Important points are the calls to step_build_wasm, step_install_wasm_bindgen, step_run_wasm_bindgen, and step_run_wasm_opt, the other 4 steps are just fluff for making a node module/npm package (the package.json allows `import {my_func} from './pkg';` instead of './pkg/${crate_name}.js'...). | |
step_build_wasm is simply `cargo build --lib --release --target wasm32-unknown-unknown` | |
https://github.com/rustwasm/wasm-pack/blob/master/src/build/mod.rs#L76 | |
step_install_wasm_bindgen is what justifies wasm-pack's existence because whatever version of wasm-bindgen your crate depends on requires that you use a corresponding version of wasm-bindgen-cli to generate the bindings correctly. It will either use an existing install, download a precompiled version, or run `cargo |
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
# MyDefrag v4.0 default script: System Disk Daily | |
# | |
# This script is part of the standard MyDefrag distribution. | |
Title("Damian's Daily") | |
Description("System Disk Daily description") // See the "Settings.MyD" file. | |
WindowSize(minimized) | |
#WhenFinished(exit) |
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 fs = require('fs-extra'); | |
const {gzip,ungzip:gunzip} = require('node-gzip'); | |
//const decoder = new require('string_decoder').StringDecoder('utf8'); | |
//const {toByteArray:b64dec,fromByteArray:b64enc} = require('base64-js'); | |
//const {encode:yEnc,decode:yDec} = require('yenc-stream'); | |
const qrI = require('qr-image'); | |
//const qrC = require('qrcode'); | |
async function encoder(jsonStr) { | |
//let jsonStr=await fs.readFile('/home/damian/Downloads/F8KKsSyF.txt','utf-8'); |
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 sleep=(fn,ms)=>new Promise(r=>setTimeout(()=>r(fn()),ms)); | |
const init=Date.now(); | |
const log=(y)=>console.log((Date.now()-init)+' '+y); | |
//7: Awaiting on required values immediately. Very slow. | |
(async () => { | |
const x=await sleep(()=>1,100); | |
const a=await sleep(()=>3,200); | |
const b=await sleep(()=>4,300); |
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 | |
tabris=require('tabris') | |
,page=new tabris.Page({ | |
topLevel:true, | |
title:"myapp" | |
}) | |
,pain=0 | |
,grumpy; | |
new tabris.Button({ |