Skip to content

Instantly share code, notes, and snippets.

View mikaelkaron's full-sized avatar

Mikael Karon mikaelkaron

View GitHub Profile
Verifying that "mikaelkaron.id" is my Blockstack ID. https://explorer.blockstack.org/name/mikaelkaron.id
Verifying my Blockstack ID is secured with the address 18q7afzib633kN75SDPPZc4NfRsspY9Agj https://explorer.blockstack.org/address/18q7afzib633kN75SDPPZc4NfRsspY9Agj

Keybase proof

I hereby claim:

  • I am mikaelkaron on github.
  • I am mikaelkaron (https://keybase.io/mikaelkaron) on keybase.
  • I have a public key whose fingerprint is 71F7 16DD 5417 25B1 D94E 7EC6 CBC1 8BD4 3204 8D28

To claim this, I am signing this object:

@mikaelkaron
mikaelkaron / build.js
Last active April 26, 2017 17:10
SystemJS package an existing bundle
var Builder = require("systemjs-builder");
var builder = new Builder({
baseURL: "node_modules",
map: {
"jquery": "jquery/dist/jquery.js",
"text": "systemjs-plugin-text/text.js",
"css": "systemjs-plugin-css/css.js",
"clerk": "."
},
@mikaelkaron
mikaelkaron / module.js
Last active August 29, 2015 14:06
Async jquery multi ajax
define([ "when/parallel", "jquery" ], function (parallel, $) {
var tasks = [ "url1", "url2", "url3" ].map(function (url) {
return function () {
return $.get(url);
};
});
parallel(tasks)
.then(function (results) {
@mikaelkaron
mikaelkaron / gist:215a54f962cb57243f09
Last active August 29, 2015 14:04
Simple speed tester
(function (sources, delay, success, fail) {
function onload() {
this.stop = new Date().getTime();
window.setTimeout(next, success.apply(this, arguments) || delay);
}
function onerror() {
this.stop = new Date().getTime();
window.setTimeout(next, fail.apply(this, arguments) || delay);
}
@mikaelkaron
mikaelkaron / inner.html
Last active August 29, 2015 13:57 — forked from ika18/inner.html
<div>hola</div>
@mikaelkaron
mikaelkaron / simple.js
Last active August 29, 2015 13:56
Parsing a semver string and translating values
"1.2.3-pre+build".match(/(\d+)(?:\.(\d+)(?:\.(\d+))?)?(?:-([^+]+))?(?:\+(.+))?/).map(function (value, index) { return index > 0 && index < 4 ? parseInt(value || 0) : value; });
@mikaelkaron
mikaelkaron / process.js
Created July 12, 2013 08:16
Process RequireJS configuration
/**
* Processes a RequireJS config
* @scope {Object} RequireJS config
* @param {Object} Components from bower.lock
* @returns {Object} Processed RequireJS config
*/
function process(components) {
var ARRAY_PUSH = Array.prototype.push;
var NAME = "name";
var LOCATION = "location";
@mikaelkaron
mikaelkaron / index.html
Created July 5, 2013 02:24
Multi context setup for troop
<!doctype html>
<html lang="en">
<body>
<script type="text/javascript">
"use strict";
var require = (function () {
/**
* Troopifies requirejs configuration
* @param {String} troopjs_location_default Default location of the trooplib (if not configured in packages)
*/