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
// avcodec_sample.0.5.0.c | |
// Original source: | |
// http://web.me.com/dhoerl/Home/Tech_Blog/Entries/2009/1/22_Revised_avcodec_sample.c.html | |
// | |
// A small sample program that shows how to use libavformat and libavcodec to | |
// read video from a file. | |
// | |
// This version is for the 0.4.9+ release of ffmpeg. This release adds the | |
// av_read_frame() API call, which simplifies the reading of video frames |
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
Rabbitmq conf locations for homebrew | |
/usr/local/etc/rabbitmq/rabbitmq-env.conf | |
/usr/local/etc/rabbitmq/rabbitmq |
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
if (!Object.prototype.sizeof) { | |
Object.defineProperty(Object.prototype, 'sizeof', { | |
value: function() { | |
var counter = 0; | |
for (index in this) counter++; | |
return counter; | |
}, | |
enumerable: false | |
}); | |
} |
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
mat4 rotationMatrix(vec3 axis, float angle) | |
{ | |
axis = normalize(axis); | |
float s = sin(angle); | |
float c = cos(angle); | |
float oc = 1.0 - c; | |
return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, | |
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, | |
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.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
import precog.macro.ValueClass; | |
class ABC implements ValueClass { | |
var a: Int; | |
var b: Bool; | |
var c: String; | |
} | |
/* | |
class ABC extends ValueClass { |
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 haxe.macro.Expr; | |
using haxe.macro.Tools; | |
abstract Fast(Xml) from Xml to Xml { | |
@:noCompletion public inline function new(xml:Xml) this = xml; | |
public var name(get,never):String; | |
inline function get_name() return this.nodeName; | |
public var elements(get,never):FastIterator; |
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
user web; | |
# One worker process per CPU core. | |
worker_processes 8; | |
# Also set | |
# /etc/security/limits.conf | |
# web soft nofile 65535 | |
# web hard nofile 65535 | |
# /etc/default/nginx |
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
// Watch accesses/sets on a DOM element property. | |
function watchPropsOn(el) { | |
return new Proxy(el, { | |
get(target, propKey, receiver) { | |
//return Reflect.get(target, propKey, receiver); | |
console.log('get', propKey); | |
return el[propKey]; | |
}, | |
set(target, propKey, value, receiver) { | |
console.log('set', propKey, value); |
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
# Install QEMU OSX port with ARM support | |
sudo port install qemu +target_arm | |
export QEMU=$(which qemu-system-arm) | |
# Dowload kernel and export location | |
curl -OL \ | |
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie | |
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie | |
# Download filesystem and export location |
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 chunkedUrl = 'https://jigsaw.w3.org/HTTP/ChunkedScript'; | |
fetch(chunkedUrl) | |
.then(processChunkedResponse) | |
.then(onChunkedResponseComplete) | |
.catch(onChunkedResponseError) | |
; | |
function onChunkedResponseComplete(result) { | |
console.log('all done!', result) | |
} |
OlderNewer