NOTE: This is outdated. Check the comments below for more up-to-date forks of this gist.
Improved YARD CHEATSHEET http://yardoc.org
forked from https://gist.github.com/chetan/1827484 which is from early 2012 and contains outdated information.
# Load importer part of fiddle (ffi) library | |
require 'fiddle/import' | |
# Create module as body for an importer instance | |
module MessageBox | |
# Extend this module to an importer | |
extend Fiddle::Importer | |
# Load 'user32' dynamic library into this importer | |
dlload 'user32' | |
# Set C aliases to this importer for further understanding of function signatures |
function limitEval(code, fnOnStop, opt_timeoutInMS) { | |
var id = Math.random() + 1, | |
blob = new Blob( | |
['onmessage=function(a){a=a.data;postMessage({i:a.i+1});postMessage({r:eval.call(this,a.c),i:a.i})};'], | |
{ type:'text/javascript' } | |
), | |
myWorker = new Worker(URL.createObjectURL(blob)); | |
function onDone() { | |
URL.revokeObjectURL(blob); |
=begin | |
RGSSRuntime Module 1.0 for RPG Maker XP/VX/VX Ace | |
http://orzFly.com/html/rgssruntime.html | |
Copyright 2013-2014 Yeechan Lu a.k.a. orzFly <i@orzFly.com> | |
Partial Copyright 2013-2014 Seiran A. [http://seiran.mist.so/] | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the "Software"), |
// Original is http://d.hatena.ne.jp/uupaa/20090116/1232051707 | |
var array = []; | |
var notarray = {}; | |
(function () { | |
var S = new Date*1; | |
var toString = Object.prototype.toString; | |
for (var i = 0; i < 5000000; i++) { ( toString.call(array) === "[object Array]" ) } | |
print('Array#Object.prototype.toString.call : ' + (new Date-S)); | |
}()); |
// This is free and unencumbered software released into the public domain. | |
// Marshals a string to an Uint8Array. | |
function encodeUTF8(s) { | |
var i = 0, bytes = new Uint8Array(s.length * 4); | |
for (var ci = 0; ci != s.length; ci++) { | |
var c = s.charCodeAt(ci); | |
if (c < 128) { | |
bytes[i++] = c; | |
continue; |
all: emit scan parse | |
emit.o: emit.c | |
gcc -c emit.c -g -O0 -Wall | |
emit: emit.o | |
gcc -o emit emit.o -lyaml | |
scan.o: scan.c |
NOTE: This is outdated. Check the comments below for more up-to-date forks of this gist.
forked from https://gist.github.com/chetan/1827484 which is from early 2012 and contains outdated information.
/* | |
What happens? | |
- `new Type().what` is looked up with a call to `get` on the proxy | |
- a function is returned that will look up `METHOD_NAME` when called | |
- `METHOD_NAME` is called because of the `()` behind `new Type().what` | |
- if `METHOD_NAME` exists on you object, your own function is called | |
- if not, because of prototypal inheritance, `get` is called again | |
- `name` is now `METHOD_NAME` and we can throw as we know `METHOD_NAME` is not implemented on the type | |
credits http://soft.vub.ac.be/~tvcutsem/proxies/ |
<script> | |
var module = WebAssembly.instantiateStreaming(fetch("linked_list.wasm"), {}); | |
</script> |