Skip to content

Instantly share code, notes, and snippets.

@as-com
as-com / Untitled.png
Last active September 24, 2019 02:39
Untitled.png
@as-com
as-com / discuss.user.js
Created July 20, 2017 16:18 — forked from GarethPW/discuss.js
Brings the discuss button back to the Scratch Website.
// ==UserScript==
// @name Scratch 2.0 Discuss Button Fix
// @namespace http://garethpw.net
// @version 1.1
// @description Brings back the discuss button on the site header because removing it was illogical.
// @author Gareth Welch
// @include /^https?:\/\/scratch\.mit\.edu
// ==/UserScript==
(function() {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>array vs object stuff</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@as-com
as-com / hello.c
Created August 5, 2016 13:50
llvm-cbe output for a C++ hello world. (You may need to remove the include for APInt-C.h to compile)
/* Provide Declarations */
#include <stdarg.h>
#include <setjmp.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <APInt-C.h>
#ifndef __cplusplus
typedef unsigned char bool;
@as-com
as-com / results.txt
Created April 19, 2016 12:04
fast.js benchmarks, node 5.10.1
> fast.js@0.1.1 bench /Users/andrew/Documents/fast.js
> node ./bench/index.js
Running 55 benchmarks, please wait...
Native .fill() vs fast.fill() (3 items)
✓ Array.prototype.fill() x 9,988,493 ops/sec ±1.55% (87 runs sampled)
✓ fast.fill() x 39,712,880 ops/sec ±1.70% (88 runs sampled)
[][(!1+[])[+[]]+([!1]+[][[]])[1+[+[]]]+(!1+[])[2]+(!1+[])[2]][([]+[][(!1+[])[+[]]+([!1]+[][[]])[1+[+[]]]+(!1+[])[2]+(!1+[])[2]])[3]+(!0+[][(!1+[])[+[]]+([!1]+[][[]])[1+[+[]]]+(!1+[])[2]+(!1+[])[2]])[1+[+[]]]+([][[]]+[])[1]+(!1+[])[3]+(!0+[])[+[]]+(!0+[])[1]+([][[]]+[])[+[]]+([]+[][(!1+[])[+[]]+([!1]+[][[]])[1+[+[]]]+(!1+[])[2]+(!1+[])[2]])[3]+(!0+[])[+[]]+(!0+[][(!1+[])[+[]]+([!1]+[][[]])[1+[+[]]]+(!1+[])[2]+(!1+[])[2]])[1+[+[]]]+(!0+[])[1]]((+[]+[!0]+[][[]]+!1+ +[]+!1+ +[]+[][[]]+!1+ +[]+ +[]+[][[]]+!1+!0+1+!1+([][[]]+[])[+[]]+!1+!0+!0+[][[]]+!1+!0+1+!1+ +[]+[][[]]+!1+(!0+[])[1]+!1+1+ +[]+!1+ +[]+ +[]+!1+[][[]]+!0+[][[]]+!1+1+[][[]]+!1+ +[]+[][[]]+!1+ +[]+!0+ +[]+!1+!0+!0+!0+!1+[][[]]+ +[]+!0+!1+ +[]+ +[!1]+!1+ +[]+!1+ +[]+[][[]]+!1+[][[]]+ +[]+!0+!1+ +[]+!0+ +[]+!1+ +[!1]+[][[]]+!1+!0+[][[]]+!1+ +[]+!0+1+!1+(+[!1]+[])[+[]]+!1+([][[]]+[])[+[]]+!1+!0+ +[!1]+!0+!1+ +[]+1+!0+!1+!0+ +[]+1+!1+ +[]+(!1+[])[+[]]+!1+1+[][[]]+!1+(+[!1]+[])[+[]]+!1+1+ +[]+!1+!0+ +[!1]+!1+!0+1+!1+(!0+[])[1]+!1+ +[]+!0+ +[]+!1+1+ +[]+!1
@as-com
as-com / highlight.pack.js
Created March 27, 2016 01:09
highlightjs with all languages
/*! highlight.js v9.2.0 | BSD3 License | git.io/hljslicense */
!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){return/^(no-?highlight|plain|text)$/i.test(e)}function i(e){var n,t,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=/\blang(?:uage)?-([\w-]+)\b/i.exec(i))return w(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,r=i.length;r>n;n++)if(w(i[n])||a(i[n]))return i[n]}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",o

Keybase proof

I hereby claim:

  • I am as-com on github.
  • I am ascom (https://keybase.io/ascom) on keybase.
  • I have a public key whose fingerprint is 2325 45AB 4D20 5018 6CCB C14B CC43 98B4 5AF5 5252

To claim this, I am signing this object:

// https://github.com/beatgammit/base64-js/blob/master/lib/b64.js
!function(r){"use strict";function t(r){var t=f[r.charCodeAt(0)];return void 0!==t?t:-1}function n(r){function n(r){i[f++]=r}var e,a,h,o,c,i;if(r.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=r.length;c="="===r.charAt(u-2)?2:"="===r.charAt(u-1)?1:0,i=new A(3*r.length/4-c),h=c>0?r.length-4:r.length;var f=0;for(e=0,a=0;h>e;e+=4,a+=3)o=t(r.charAt(e))<<18|t(r.charAt(e+1))<<12|t(r.charAt(e+2))<<6|t(r.charAt(e+3)),n((16711680&o)>>16),n((65280&o)>>8),n(255&o);return 2===c?(o=t(r.charAt(e))<<2|t(r.charAt(e+1))>>4,n(255&o)):1===c&&(o=t(r.charAt(e))<<10|t(r.charAt(e+1))<<4|t(r.charAt(e+2))>>2,n(o>>8&255),n(255&o)),i}function e(r){return u[r]}function a(r){return e(r>>18&63)+e(r>>12&63)+e(r>>6&63)+e(63&r)}function h(r,t,n){for(var e,h=[],o=t;n>o;o+=3)e=(r[o]<<16)+(r[o+1]<<8)+r[o+2],h.push(a(e));return h.join("")}function o(r){var t,n,a,o=r.length%3,c="",i=[],u=16383;for(t=0,a=r.length-o;a>t;t+=u)i.push(h(r,t,t+u>a?a:t+
!function(n,e){"use strict";function t(n){for(var e=Object.create(null),t=0;t<n.length;++t)e[n[t]]=!0;return e}function r(n){return n.split("")}function i(n,e){for(var t=e.length;--t>=0;)if(e[t]==n)return!0;return!1}function o(n,e){for(var t=0,r=e.length;r>t;++t)if(n(e[t]))return e[t]}function a(n,e){if(0>=e)return"";if(1==e)return n;var t=a(n,e>>1);return t+=t,1&e&&(t+=n),t}function u(n,e){Error.call(this,n),this.msg=n,this.defs=e}function s(n,e,t){n===!0&&(n={});var r=n||{};if(t)for(var i in r)r.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&u.croak("`"+i+"` is not a supported option",e);for(var i in e)e.hasOwnProperty(i)&&(r[i]=n&&n.hasOwnProperty(i)?n[i]:e[i]);return r}function c(n,e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r],t++);return t}function f(){}function l(n,e){n.indexOf(e)<0&&n.push(e)}function p(n,e){return n.replace(/\{(.+?)\}/g,function(n,t){return e[t]})}function d(n,e){for(var t=n.length;--t>=0;)n[t]===e&&n.splice(t,1)}function h(n,e){function t(n,t){for(var r=[],i=0,o=0,a=0;i<n.lengt