Skip to content

Instantly share code, notes, and snippets.

@emonkak
emonkak / Beep.hs
Created September 5, 2011 02:03
Beep.hs
import Control.Concurrent
import Control.Monad
import Reactive.Banana
import System.IO
timer sec = do
(addHandler, runHandlers) <- liftIO newAddHandler
liftIO $ forkIO $ forever $ threadDelay (sec * 10 ^ 6) >> liftIO (runHandlers ())
fromAddHandler addHandler
@emonkak
emonkak / glib-0.12.1-ghc-7.2.patch
Created September 8, 2011 02:06
glib-0.12.1-ghc-7.2.patch
diff --git a/System/Glib/UTFString.hs b/System/Glib/UTFString.hs
index de54d16..1758414 100644
--- a/System/Glib/UTFString.hs
+++ b/System/Glib/UTFString.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-- GIMP Toolkit (GTK) UTF aware string marshalling
--
-- Author : Axel Simon
@@ -55,46 +56,78 @@ import System.Glib.FFI
@emonkak
emonkak / extract
Created September 14, 2011 06:39
extract
#!/bin/sh
function main
{
local dest=.
while getopts 'd:' OPT
do
case $OPT in
'd') dest="$OPTARG" ;;
@emonkak
emonkak / ehgm.scm
Created September 14, 2011 06:39
ehgm.scm
#!/usr/bin/env gosh
; Version: 0.00
; Copyright (C) 2011 emonkak <[email protected]>
; License: MIT license {{{
; Permission is hereby granted, free of charge, to any person obtaining
; a copy of this software and associated documentation files (the
; "Software"), to deal in the Software without restriction, including
; without limitation the rights to use, copy, modify, merge, publish,
; distribute, sublicense, and/or sell copies of the Software, and to
; permit persons to whom the Software is furnished to do so, subject to
@emonkak
emonkak / getmimizundat.pl
Created September 14, 2011 06:42
getmimizundat.pl
#!/usr/bin/perl
use strict;
use warnings;
use File::Path;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
my $LOGDIR = "$ENV{'HOME'}/.jd";
@emonkak
emonkak / dvd-database.rb
Created September 14, 2011 10:31
dvd-database.rb
#!/usr/bin/ruby
require 'optparse'
require 'pathname'
require 'yaml/store'
require 'yaml_waml'
DATABASE = ENV['HOME'] + '/Documents/dvd-database.yml'
def get_entries(path)
@emonkak
emonkak / JIS0201.TXT
Created September 15, 2011 12:01
anex86-font-to-bdf.scm
0x20 0x0020 # SPACE
0x21 0x0021 # EXCLAMATION MARK
0x22 0x0022 # QUOTATION MARK
0x23 0x0023 # NUMBER SIGN
0x24 0x0024 # DOLLAR SIGN
0x25 0x0025 # PERCENT SIGN
0x26 0x0026 # AMPERSAND
0x27 0x0027 # APOSTROPHE
0x28 0x0028 # LEFT PARENTHESIS
0x29 0x0029 # RIGHT PARENTHESIS
@emonkak
emonkak / user.action
Created September 20, 2011 01:25
privoxy filter for sweetnote.com
{ +filter{sweetnote-board-filter} }
www.sweetnote.com/board
{ +filter{sweetnote-site-filter} }
www.sweetnote.com/site
@emonkak
emonkak / ldr-reload-image-without-referer.user.js
Created September 21, 2011 06:06
ldr-reload-image-without-referer.user.js
// ==UserScript==
// @name ldr-reload-image-without-referer
// @include http://reader.livedoor.com/reader/
// @include http://fastladder.com/reader/
// ==/UserScript==
(function() {
function initPool() {
var origin = location.protocol + '//' + location.host;
var html = document.implementation.createHTMLDocument('');
@emonkak
emonkak / make-dict-from-javadoc-index.vim
Created October 3, 2011 16:31
make-dict-from-javadoc-index.vim
for file in split(glob('index-*.html'), '\n')
let _ = []
for line in readfile(file)
let str = matchstr(line, '^<dt><span class="strong"><a\s.\{-}>\zs[A-Za-z0-9._]\+')
if str != ''
call add(_, str)
endif
endfor
call writefile(_, file . '.tmp')
endfor