This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface SilentSwitchOverrider : NSObject | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ArrayPartitionFromPrefixMarkers(array, start, stop) { | |
const partition = [] | |
let inPartition = false | |
for (let i = 0; i < array.length; ++i) { | |
const element = array[i] | |
// test element for start prefix to determine | |
// if we should enter partition view | |
if (false == inPartition && start == element.substring(0, start.length)) { | |
inPartition = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const quat = require('gl-quat') | |
const regl = require('regl')() | |
const model = require('regl-model')(regl) | |
const bunny = require('regl-primitive')(regl, require('bunny')) | |
const camera = require('regl-camera')(regl, {distance: 40}) | |
const material = regl({ | |
vert: ` | |
precision mediump float; | |
attribute vec3 position, normal; | |
uniform mat4 projection, model, view; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
let co = require('co') | |
function * list (array, subdivision) { | |
let deferred = Promise.defer() | |
let marker = 0; | |
let stop = marker + subdivision | |
let max = A.length | |
let to = Math.random() * 1000 | 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='lsplayer-wrapper' | |
style='display: block; position: relative; height: 0; padding-bottom: 56.25%;'> | |
<iframe src='https://embed.littlstar.com/videos/f2760f4a' | |
class='lsplayer-frame' | |
style='display: block; width: 100%; height: 100%; position: absolute; top: 0; left: 0; right: 0; bottom: 0;' | |
frameborder='0' | |
allowfullscreen></iframe> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
function * createPromises () { | |
let max = 5 | |
for (let i = 0; i < max; ++i) { | |
yield new Promise(done => { | |
const to = Math.random() * i * 100 | |
setTimeout(() => { | |
console.log('done %dms for i=%d', to, i) | |
done(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
import { UPDATE, createContainer } from 'stardux' | |
let domElement = document.createElement('div') | |
let template = '#{spinner}' | |
let initialState = {spin: false, spinner: ''} | |
let container = createContainer(domElement, initialState, reducer) | |
domElement.innerHTML = template | |
function reducer (state, action) { | |
switch (action.type) { | |
case UPDATE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// kronecker delta | |
let kd = (i, j) => i == j ? 1 : 0; | |
// (In)ij identity matrix constructor | |
let I = n => { | |
let a = [], k = 0; | |
for (let i = 0; i < n; ++i) | |
for (let j = 0; j < n; ++j) | |
a[k++] = kd(i, j); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="https://rawgit.com/littlstar/axis/master/dist/axis.css"/> | |
<script type="text/javascript" src="https://rawgit.com/littlstar/axis/master/dist/axis.js"></script> | |
</head> | |
<body> | |
<div id="video"></div> | |
<script type="text/javascript"> | |
var domElement = document.querySelector('#video'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var m = {exports: {}}; | |
(function (module, exports, require) { | |
console.log(module, exports, require('./foo.js')); | |
})(m, m.exports, function (name) { return Function(String(fs.readFileSync(name)))(); }); |