Skip to content

Instantly share code, notes, and snippets.

@yurydelendik
yurydelendik / !wasmllvm.md
Last active February 23, 2024 05:08
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@jbalducc
jbalducc / gruntfinalize.js
Last active December 11, 2015 10:49
A grunt file to be added in yeoman build task after rjs and rev tasks. input : /<md5>.main.js /<md5>.core.js /package/<md5>.pack1.js output : /<md5>.main.js /<md5>.main.src.js /<md5>.main.js.map /<md5>.core.js /<md5>.core.src.js /<md5>.core.js.map /<md5>.pack1.js /<md5>.pack1.src.js /<md5>.pack1.js.map with main.js containing a map in paths with…
grunt.registerTask('finalize', function () {
var cdnBaseUrl = "//mycdn/scripts/"; // CDN Url where files will be hosted
var pathBase = "./dist/scripts/"; // Local directory where files are already optimized with rjs and already revved (like d4edefds.file.js)
function revmd5(fileContent) {
var hash = crypto.createHash("md5");
hash.update(fileContent);
// 8 chars will be sufficient
return hash.digest('hex').slice(0, 8);
}
@lukehoban
lukehoban / gist:2246758
Created March 30, 2012 05:17
ES6 module loader API polyfill experiment
(function (global) {
// TODO: Delegate to parent loader in various places
// TODO: Canonicalization
// TODO: Can we do better for 'eval'?
/// Module loader constructor
function Loader(parent, options) {
// Initialization of loader state from options
@Yaffle
Yaffle / URLUtils.js
Last active September 5, 2022 02:19
parse URL + absolutize URL in javascript (URLUtils shim - http://url.spec.whatwg.org/#url)
/*jslint regexp: true, maxerr: 50, indent: 2 */
(function (global) {
"use strict";
function URLUtils(url, baseURL) {
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
if (!m) {
throw new RangeError();
}