Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl6
use v6;
use NativeCall;
constant LIB = ($*DISTRO.name eq 'macosx') ?? './OpenCL' !! 'OpenCL';
constant cl_int = int32;
constant cl_uint = uint32;
constant cl_char = int8;
@kmwallio
kmwallio / summary.coffee
Last active December 18, 2015 08:29
Crappy Automated summary using Coffee-Script. Requires natural and Sylvester
#!/usr/bin/env coffee
natural = require 'natural'
sylvester = require 'sylvester'
fs = require 'fs'
if process.argv[2]? and process.argv[3]?
# Read in the given file
fs.readFile process.argv[2], (err, data) ->
# Tokenize into sentences
@kmwallio
kmwallio / gpdf2text.pl
Last active December 18, 2015 07:19
Converts a Graphical PDF to text using Tesseact-OCR. Needs ImageMagick, Tesseract and possible xpdf installed (use homebrew). Use: gpdf2text.pl input.pdf output.txt
#!/usr/bin/perl
use File::Copy "cp";
use File::Path qw(make_path remove_tree);
my $file_name = $ARGV[0];
my $out_file = $ARGV[1] eq '' ? 'text.txt' : $ARGV[1];
if ($file_name eq '') {
print "\n\n" . 'Usage:' . "\n";
@kmwallio
kmwallio / outlook-fluid.js
Last active May 9, 2017 16:06
Userscript for badge icon and beep notifications for outlook.com in a Fluid App (SSB).
// use for patterns:
// *live.com*
// *outlook.com*
var playBeep = true;
window.fluid.dockBadge = '';
var numMessages = 0;
setTimeout(updateDockBadge, 1000);