Skip to content

Instantly share code, notes, and snippets.

@hatsuseno
hatsuseno / datauri.pl
Last active December 19, 2015 09:29
Simple utility that converts it's standard in into a data URI. Attempts to guess the mimetype of the content using `File::MimeInfo::Magic::mimetype`.
#!/usr/bin/perl -w
use strict;
use URI;
use File::MimeInfo::Magic qw[mimetype];
my $stdin;
{
@hatsuseno
hatsuseno / Hunspell.php
Created October 14, 2012 20:39 — forked from sebskuse/hunspell.class.php
Hunspell-PHP: A hunspell PHP wrapper
<?php
namespace CWX\Lang\Spell\HunspellWrapper;
class Hunspell {
const MISS_MATCH = "/^(?<type>[\*\-#+&])\s(?<original>\w+)\s(?<count>\d+)\s(?<offset>\d+):\s(?<misses>.*+)$/u";
private $hunspellPath;
private $dictionaries;
@hatsuseno
hatsuseno / ochack.php
Created August 24, 2012 13:37
Small hardwired script to programatically read phonenumbers stored as images on marktplaats.nl
<?php
if(!isset($argv[1])) {
die('Usage: '. $argv[0] ." <filename.gif>\n");
}
$im = imagecreatefromgif($argv[1]);
$base_col = imagecolorat($im, 0, 0);