Skip to content

Instantly share code, notes, and snippets.

@syohex
syohex / bundle.el.patch
Created December 2, 2011 14:43
同時実行の際, add-to-listとして書きだすパス名が上書きされる問題の修正
--- orig-bundle.el 2011-12-02 23:39:27.852200611 +0900
+++ bundle.el 2011-12-02 23:33:37.088195348 +0900
@@ -18,23 +18,29 @@
(defvar bundle-install-last-url nil
"The last url used in `bundle-install-from-url'.")
-(defun bundle-install-git (&optional url)
+(defun bundle-install-git (url)
"Install elisp files from a given url using git."
- (interactive)
@syohex
syohex / ansi_color_sample.pl
Created December 4, 2011 04:16
Example of ansi_color option Text::UnicodeTable::Simple
#!perl
use strict;
use warnings;
use utf8;
use Term::ANSIColor qw(:constants);
use Term::ExtendedColor qw(:all);
use Text::UnicodeTable::Simple;
binmode STDOUT, ":utf8";
@syohex
syohex / multimarkdown.pl
Created December 6, 2011 13:47
ゆーすけべーさんの markdownviewerに githubっぽい CSSを追加
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use Plack::Runner;
use Plack::Middleware::Static;
use Text::MultiMarkdown qw/markdown/;
use File::Spec;
use Data::Section::Simple qw/get_data_section/;
@syohex
syohex / open-daily-file.el
Created December 7, 2011 08:15
create daily memo to specified directory
;; create daily org memo file
(defun open-daily-file ()
(interactive)
(let* ((memodir (expand-file-name "~/memo/daily"))
(daily-path (concat memodir "/" (format-time-string "%Y/%m"))))
(unless (file-directory-p daily-path)
(make-directory daily-path t))
(let ((daily-file (concat daily-path "/" (format-time-string "%d.org"))))
(unless (file-exists-p daily-file)
(with-temp-file daily-file
@syohex
syohex / test.pl
Created December 14, 2011 14:59
quickrun.el outputter sample
#!perl
use strict;
use warnings;
use utf8;
binmode STDOUT, ":utf8";
my @chars = qw/あ い う え お/;
for my $i (1..10) {
print $chars[ int(rand(scalar @chars) ) ] . "っぱい\n";
}
@syohex
syohex / emacs_serverstart.el
Created December 18, 2011 14:32
emacs server focus in elisp
(defun my/emacs-serverstart ()
(let ((pid (emacs-pid))
(wid-file (expand-file-name
(concat user-emacs-directory "server_wid"))))
(let ((wid (if window-system
(my/emacs-window-id pid))))
(with-temp-file wid-file
(insert wid))
wid)))
@syohex
syohex / cal.pl
Created December 20, 2011 14:28
Colored Calendar
#!/usr/bin/env perl
package App::Cal;
use strict;
use warnings;
use Carp ();
use Calendar::Simple ();
use Calendar::Japanese::Holiday ();
use Getopt::Long ();
@syohex
syohex / output.txt
Created December 25, 2011 02:59
Text::AAlib Sample
. . . .
. ..,_..:
.<uasv;a`- ..
..=._ . .._s,=SnXov1=%==,=. .
. .:c{us%,, . . :_<>vZX,3psmdY={|)<=`.
.;i%vXdns=, . <mdmXX#GS{SSZSs3o>:===..
=a2dZwSY3>( :imm$#1qd}<.=IXzX<Xc :===.
. . __avVo<2Yc
@syohex
syohex / git.el
Created December 26, 2011 15:29
show git diff with color in Emacs
(defun git-diff ()
(interactive)
(let ((filename (buffer-file-name (current-buffer)))
(git-buf "*my/git*"))
(if (get-buffer git-buf)
(kill-buffer git-buf))
(with-current-buffer (get-buffer-create git-buf)
(setq buffer-read-only nil)
(erase-buffer)
(call-process "git" nil t nil "diff" filename)
@syohex
syohex / quickrun.conf
Created December 27, 2011 22:57
Configuration of quickrun.el
;; -*- mode:emacs-lisp -*-
;; require quickrun.el
(require 'anything)
(require 'quickrun)
(quickrun-add-command "c++/c11"
'((:command . "g++")
(:exec . ("%c -std=c++0x %o -o %n %s"
"%n %a"))