Skip to content

Instantly share code, notes, and snippets.

@syohex
syohex / dict-with-ace.el
Created July 25, 2012 13:51
Using dictionary with ace-jump-mode
(require 'sdic)
(require 'cl)
(require 'ace-jump-mode)
(defvar dictionary-with-ace:orig-point nil)
(defvar dictionary-with-ace:action
(lambda (word)
(sdic-describe-word word)))
@syohex
syohex / kfreebsd.log
Created August 6, 2012 13:11
modify $0 kfreebsd and Linux
syohei@kfreebsdi386:~/junk/perl$ uname -a
GNU/kFreeBSD kfreebsdi386 8.1-1-686 #0 Sat Jul 21 17:02:04 UTC 2012 i686 i386 Intel(R) Core(TM) i7-2600S CPU @ 2.80GHz GNU/kFreeBSD
syohei@kfreebsdi386:~/junk/perl$ perl --version
This is perl 5, version 16, subversion 0 (v5.16.0) built for i686-gnukfreebsd
Copyright 1987-2012, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
@syohex
syohex / gif.pl
Created August 8, 2012 00:41
Extract gif and convert these frame into png
#!perl
use strict;
use warnings;
use Imager;
my $input = shift or die "Usage: $0 inputfile";
my $imager = Imager->new;
my @imgs = $imager->read_multi(file => $input) or $imager->errstr;
@syohex
syohex / chat.psgi.patch
Created August 8, 2012 05:16
Patch for Amon2 realtime chat application example
diff --git a/eg/realtime-chat/chat.psgi b/eg/realtime-chat/chat.psgi
index 30eb2d9..4e32d8b 100644
--- a/eg/realtime-chat/chat.psgi
+++ b/eg/realtime-chat/chat.psgi
@@ -63,7 +63,7 @@ __DATA__
<section class="row">
<form id="form">
<input type="text" name="message" id="message">
- <inptu type="submit">
+ <input type="submit">
@syohex
syohex / Difflet.patch
Created August 13, 2012 11:35
Patch for Data::Difflet
diff --git a/lib/Data/Difflet.pm b/lib/Data/Difflet.pm
index ded0685..32fb40e 100644
--- a/lib/Data/Difflet.pm
+++ b/lib/Data/Difflet.pm
@@ -37,6 +37,7 @@ sub compare {
local $BUFFER = '';
no warnings 'redefine';
local *_ = sub($) { $self->ddf(@_) };
+ local $Term::ANSIColor::EACHLINE = "\n";
$self->_compare(@_);
@syohex
syohex / output.log
Created August 21, 2012 13:35
sprintf test
buf=10000, len=5
@syohex
syohex / helm-themes.el
Created August 29, 2012 14:52
Color theme with helm interface
;;; helm-themes.el --- Color theme helm interface
;; Copyright (C) 2012 by Syohei YOSHIDA
;; Author: Syohei YOSHIDA <[email protected]>
;; URL:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@syohex
syohex / ac-jsx.el
Created September 3, 2012 14:32
auto-complete for JSX
;;; ac-jsx.el --- auto-complete for JSX
;; Copyright (C) 2012 by Syohei YOSHIDA
;; Author: Syohei YOSHIDA <[email protected]>
;; URL:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@syohex
syohex / scons.patch
Created September 9, 2012 09:13
build tora language implementation
diff --git a/SConstruct b/SConstruct
index 5d32596..add9c67 100644
--- a/SConstruct
+++ b/SConstruct
@@ -51,7 +51,7 @@ if os.name == 'nt':
])
else:
env = Environment(
- LIBS=['re2', 'pthread', 'dl', 'icudata', 'icuuc'],
+ LIBS=['re2', 'pthread', 'dl', 'icudata', 'icuuc', 'boost_program_options-mt'],
@syohex
syohex / new_iterm_window.applescript
Created September 16, 2012 21:33
Open new iterm window
tell application "iTerm" to activate
tell application "System Events"
tell process "iTerm"
click menu item "New Window" of menu "Shell" of menu bar 1
end tell
end tell