Skip to content

Instantly share code, notes, and snippets.

View magcius's full-sized avatar
🐬
it's a dAmN cOld NiGhT tryin 2 figure out this life

Jasper St. Pierre magcius

🐬
it's a dAmN cOld NiGhT tryin 2 figure out this life
View GitHub Profile
#include <cairo/cairo.h>
#include <math.h>
static void
draw_region (cairo_t *cr,
cairo_region_t *region)
{
cairo_rectangle_int_t box;
int n_boxes, i;
(function(exports) {
const Gio = imports.gi.Gio;
const Soup = imports.gi.Soup;
const Mainloop = imports.mainloop;
function Deferred() {
this.callbacks = [];
this.valuePair = null;
}
(function(exports) {
const Gio = imports.gi.Gio;
const Soup = imports.gi.Soup;
const Mainloop = imports.mainloop;
function Deferred() {
this.callbacks = [];
this.valuePair = null;
}
@magcius
magcius / flash-5-page-files.txt
Created April 11, 2012 13:25
Flash 5 Page Files File Format
FLA format, "Page N" files as found in Flash 5.
Partially reverse engineered by Jasper St. Pierre.
FLA files are CFBF files (COM Structured Storage). You can parse/make them with:
http://msdn.microsoft.com/en-us/library/aa380369%28VS.85%29.aspx
http://git.gnome.org/browse/libgsf
Very helpful while making this:
http://mh-nexus.de/en/hxd/
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
static void
dump_intv (int *intv,
int count)
{
int i;
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
static void
dump_intv (int *intv,
int count)
{
int i;
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
/* merge sort in N*2 space. */
static void
mergesort_impl (int *intv,
int *tmp,
int count)
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
static void
dump_intv (int *intv,
int count)
{
int i;
#include <glib.h>
typedef struct {
GSList *stack;
char *bytecode;
char *pc;
} MachineState;
static void machine_push (MachineState *state, int v);
static int machine_pop (MachineState *state);
#include <glib.h>
typedef struct {
GSList *stack;
} MachineState;
static void machine_push (MachineState *state, int v);
static int machine_pop (MachineState *state);
/* pushes an operand onto the operand stack */