Skip to content

Instantly share code, notes, and snippets.

View FlyingJester's full-sized avatar

Martin McDonough FlyingJester

View GitHub Profile
var KL = KL || {};
KL.Particle = function(x, y, z, color, gV) {
this.v = new KL.V3(x, y, z);
this.oldV = new KL.V3(x, y, z);
this.gV = gV || null;
this.color = color || new KL.color();
this.velocity = new KL.V3();
class MediaCodecSynchro {
public:
Monitor mMonitor;
// Only these members are protected by mMonitor.
bool mFlush;
bool mDie;
bool mSleeping;
/////
// An implementation of the Sphere 1.x ByteArray object using only TypedArrays.
//
// Tested to work in SpiderMonkey and V8.
//
// Wrapper function to allow any TypedArray to 'become' a ByteArray.
function ByteArrayFromTypedArray(buffer){
var byteview;
if(buffer instanceof ArrayBuffer)
1:35.26 gecko-browser.jar
1:37.88 /Users/mozilla/ff/gd-master/gecko-dev/mobile/android/base/GeckoAppShell.java:2541: error: cannot find symbol
1:37.88 Bundle restrictions = mgr.getUserRestrictions();
1:37.89 ^
1:37.89 symbol: method getUserRestrictions()
1:37.89 location: variable mgr of type UserManager
1:37.89 /Users/mozilla/ff/gd-master/gecko-dev/mobile/android/base/GeckoAppShell.java:2554: error: cannot find symbol
1:37.89 Bundle restrictions = mgr.getUserRestrictions();
1:37.89 ^
1:37.89 symbol: method getUserRestrictions()
568012a HEAD@{1}: commit: Fixed AAC audio. Made event-based.
d53f86b HEAD@{2}: rebase finished: returning to refs/heads/AAC
d53f86b HEAD@{3}: rebase: Improved responsiveness of output loaders
5c3a2f7 HEAD@{4}: rebase: init comit
2cfc508 HEAD@{5}: rebase: Added Android Media Codec backend for the MP4Reader
6253da7 HEAD@{6}: rebase: checkout origin/master
8617a9b9 HEAD@{7}: commit: Improved responsiveness of output loaders
87ecd13 HEAD@{8}: commit: init comit
5eda2b0 HEAD@{9}: checkout: moving from master to AAC
5eda2b0 HEAD@{10}: commit: Added Android Media Codec backend for the MP4Reader
@FlyingJester
FlyingJester / setjmp_unique_ptr.cpp
Created August 1, 2014 20:54
Avoidig leaks when using setjmp/longjmp
//g++ -std=c++11 setjmp_unique_ptr.cpp -o demo
#include <cstdio>
#include <memory>
#include <csetjmp>
struct Test {
Test(){
std::fputs("Created Test.\n", stdout);
}
@FlyingJester
FlyingJester / setjmp_unique_ptr.cpp
Created August 1, 2014 20:52
setjmp/longjmp Causing leaks!
//g++ -std=c++11 setjmp_unique_ptr.cpp -o demo
#include <cstdio>
#include <memory>
#include <csetjmp>
struct Test {
Test(){
std::fputs("Created Test.\n", stdout);
}
@FlyingJester
FlyingJester / Jest_Test.js
Created July 28, 2014 08:02
Sapphire BMPFont RFN example
RequireSystemScript("colors.js");
var s = new Surface(64, 64, Black);
var Fonty = GetSystemFont();
s.drawText(Fonty, 0, 0, "Sphere");
s.drawText(Fonty, 4, 16, "Fonts!");
var PointerImage = new Image(s);
var LogoImage = new Image(new Surface("sphere.png"));
const size_t kCsdLength = 2;
uint8 csd[kCsdLength];
csd[0] = profile << 3 | frequency_index >> 1;
csd[1] = (frequency_index & 0x01) << 7 | channel_config << 3;
ScopedJavaLocalRef<jbyteArray> byte_array =
base::android::ToJavaByteArray(env, csd, kCsdLength);
Java_MediaCodecBridge_setCodecSpecificData(
env, j_format, 0, byte_array.obj());
@FlyingJester
FlyingJester / Vertex.glsl
Created July 20, 2014 20:57
Rotation causing divide-by-zero
#version 410\n\
\
uniform vec2 TS_Offset;\n\
uniform vec2 TS_RotationOffset;\n\
uniform float TS_RotationAngle;\n\
\
in vec2 TS_TextureUV;\n\
in vec4 TS_Position;\n\
in vec4 TS_Color;\n\
\