Skip to content

Instantly share code, notes, and snippets.

View gkatsev's full-sized avatar

Gary Katsevman gkatsev

View GitHub Profile
<title>backbone-nested amd require</title>
<script data-main="amd-require.js" src="../vendor/requirejs/require.js"></script>
test('patchCanPlayType patches canplaytype with our function, conditionally', function() {
var oldAV = vjs.ANDROID_VERSION,
video = document.createElement('video'),
canPlayType = vjs.TEST_VID.constructor.prototype.canPlayType,
patchedCanPlayType,
unpatchedCanPlayType;
vjs.ANDROID_VERSION = 4.0;
vjs.Html5.patchCanPlayType();
@gkatsev
gkatsev / gist:10492585
Created April 11, 2014 19:01
Trying to install flex-sdk 4.6.0-0 with the version being specified in `package.json`.
0 info it worked if it ends with ok
1 verbose cli [ '/Users/gkatsevman/.nvm/v0.10.24/bin/node',
1 verbose cli '/Users/gkatsevman/.nvm/v0.10.24/bin/npm',
1 verbose cli 'install',
1 verbose cli 'flex-sdk' ]
2 info using [email protected]
3 info using [email protected]
4 verbose readDependencies using package.json deps
5 verbose cache add [ 'flex-sdk', null ]
6 verbose cache add name=undefined spec="flex-sdk" args=["flex-sdk",null]
@gkatsev
gkatsev / triforce.sh
Created May 6, 2014 22:55
Using [zelda](https://www.npmjs.org/package/zelda), cross npm link all projects with all other projects. Just clone all your node modules into the same folder, cd into that folder and run the script below.
for i in *; do
if [ -d "$i" ]; then
cd $i;
if [ -f "package.json" ]; then
zelda ../;
fi;
cd ..;
fi;
done
@gkatsev
gkatsev / gist:4fb70d255b08ae5ce1d3
Last active August 29, 2015 14:01
In case you weren't sure what this function does.
/**
* Update the player duration
*/
updateDuration = function(playlist) {
// update the duration
player.duration(totalDuration(playlist));
};
@gkatsev
gkatsev / gist:6be3e990c5e808e88f37
Last active August 29, 2015 14:02
Got the following after an `npm install -g npm`.
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/Users/gkatsevman/.nvm/v0.10.28/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'npm' ]
2 info using [email protected]
3 info using [email protected]
4 verbose cache add [ 'npm', null ]
5 verbose cache add name=undefined spec="npm" args=["npm",null]
@gkatsev
gkatsev / better
Last active August 29, 2015 14:05
function foo(err, key) {
if (err) {
return console.error(err);
}
var someKey = key;
var somethingElse = something(someKey);
doSomethingElse(somethingElse);
}
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-35-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: SandForce Driven SSDs
Device Model: OCZ-AGILITY3
Serial Number: OCZ-P4WNM1M2SPF1536W
LU WWN Device Id: 5 e83a97 e370c5b95
Firmware Version: 2.15
User Capacity: 120,034,123,776 bytes [120 GB]

Mid-segment switching

Things to aim for

  • turn the in-memory buffer from segments to tags
  • in drainBuffer, seed in enough tags so that 1s (less? more?) of content is in there, with at least a delta of one keyframe
  • when new segments arrive, replace overlapping tags in the in-memory buffer
    • never replace tags in previous discontinuities

Equations

`--> make all
gcc shovel.c `js24-config --cflags --libs` -o shovel.bin -O3 -Werror -Wunused
In file included from /usr/include/mozjs-24/mozilla/Casting.h:12:0,
from /usr/include/mozjs-24/mozilla/FloatingPoint.h:13,
from /usr/include/mozjs-24/jsapi.h:12,
from shovel.c:2:
/usr/include/mozjs-24/mozilla/TypeTraits.h:19:1: error: unknown type name ‘namespace’
namespace mozilla {
^
/usr/include/mozjs-24/mozilla/TypeTraits.h:19:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token