Skip to content

Instantly share code, notes, and snippets.

/**
@hint
@see https://wiki.mozilla.org/Audio_Data_API
@see http://www.opensource.apple.com/source/WebCore/WebCore-737.5/html/canvas/
@see https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html
Array.U32 = $G.Uint32Array || $G.WebGLUnsignedIntArray || $G.CanvasUnsignedIntArray || Array;
Array.U16 = $G.Uint16Array || $G.WebGLUnsignedShortArray || $G.CanvasUnsignedShortArray || Array;
Array.U8 = $G.Uint8Array || $G.WebGLUnsignedByteArray || $G.CanvasUnsignedByteArray || Array;
/**
* This library defines magic properties and methods
* for objects. Generic hooks are: __get__, __set__,
* __delete__, __count__, __call__, __construct__,
* __noSuchProperty__ and __noSuchMethod__.
*
* Used features: Harmony (ES6) proxies.
*
* Tested in FF4 beta.
*
@cms
cms / es3-es5-incompatibilities.js
Created October 27, 2010 18:55
List of ES3 Incompatibilities introduced by ES5
/*
* List of ES3 Incompatibilities introduced by ES5.
*
*/
/*
* From Annex E:
*/
// lambda lifting (http://en.wikipedia.org/wiki/Lambda_lifting)
// in GNU C; use inner functions which are not closures
// of course, but have access to free variables
//
// by Dmitry A. Soshnikov
#include <stdio.h>
// a pointer to a function type
typedef int (*funcPtr)(int);
@somebody32
somebody32 / gist:5232120
Last active October 4, 2022 08:19
Список литературы для ознакомления с concurrent programming и реализацией этих принципов и подходов на ruby. Огромное спасибо @brainopia за составление.

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

@arsatiki
arsatiki / Main.elm
Created January 23, 2014 06:54
Hack to load elm code into node.js. Requires path to Elm runtime file. Also included is an example file.
module Squarer where
import JavaScript as JS
foreign import jsevent "input"
(JS.fromInt 0)
inputs: Signal JS.JSNumber
foreign export jsevent "reply"
outputs: Signal JS.JSNumber
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
/**
* @fileoverview Utils Interface credit card validation methods.
* @author (Wind Tammer)
*/
utils = {};
/** @type {Object<Function>} */
utils.creditcard = {};
@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@swannodette
swannodette / inference.md
Last active August 7, 2023 16:13
Externs Inference

Externs Inference

Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).

In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen