Skip to content

Instantly share code, notes, and snippets.

// POSIX-compliant (?) prototype to test mapping small pages and getting signals on protected accesses.
#include <sys/mman.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <setjmp.h>
static void* first_page;
@pguyot
pguyot / build-potrace.sh
Created May 21, 2014 07:20
Build script for potrace for iOS
#!/bin/sh
# Automatic build script for potrace
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 19.02.12.
# Copyright 2012 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@pguyot
pguyot / hough.js
Last active April 18, 2016 15:32
Hough transform
var fs = require("fs"),
Canvas = require("canvas"),
Image = Canvas.Image;
var LEAST_REQUIRED_DISTANCE = 20, // LEAST required distance between 2 points , lets say smallest ellipse minor
LEAST_REQUIRED_ELLIPSES = 80, // number of found ellipse
arr_accum = [],
arr_edges = [],
edges_canvas,