This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Invoke the ``dired'' of current working directory in Emacs buffer. | |
function dired () { | |
emacsclient -e "(dired \"${1:a}\")" | |
} | |
## Chdir to the ``default-directory'' of currently opened in Emacs buffer. | |
function cde () { | |
EMACS_CWD=`emacsclient -e " | |
(expand-file-name | |
(with-current-buffer (e2wm:current-buffer) default-directory))" | sed 's/^"\(.*\)"$/\1/'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PATH=$PATH:/opt/local/bin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin | |
export PATH | |
LOG=/tmp/cmew.log | |
nice -n 19 $HOME/.cabal/bin/cmew 1> $LOG | |
if [ ! "$?" -eq 0 ]; then | |
cat $LOG >&2 | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# $Id$ | |
# | |
# PROVIDE: tcpserver-pop3 | |
# REQUIRE: NETWORKING SERVERS | |
# BEFORE: DAEMON | |
# KEYWORD: shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################# | |
# | |
# Cocoa-Emacs Makefile | |
# | |
################################################################################# | |
PREFIX = /Users/nanasess/src/cocoa-emacs | |
RM = /bin/rm -rfv | |
TAR = tar xvzf | |
CURL = curl -O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun sqlf (s end) | |
"format the sql of region." | |
(interactive "r") | |
(let ((case-fold-search t)) | |
(let* ((s (buffer-substring-no-properties s end)) | |
(s (replace-regexp-in-string "\\(select \\)" "\n\\1\n " s)) | |
(s (replace-regexp-in-string "\\(update \\)" "\n\\1\n " s)) | |
(s (replace-regexp-in-string "\\(insert into \\)\\(fuga\\)\\(fuga\\)" "\n\\2\n " s)) | |
(s (replace-regexp-in-string "\\(delete from \\)" "\n\\1\n " s)) | |
(s (replace-regexp-in-string "\\(create table \\)" "\n\\1\n " s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $column = ''; | |
while (my $line = <STDIN>) { | |
my $count = 0; | |
$line .= <STDIN> while ($line =~ tr/"// % 2 and !eof(STDIN)); | |
$line =~ s/(?:\x0D\x0A|[\x0D\x0A])?$/,/; | |
my @values = map {/^"(.*)"$/s ? scalar($_ = $1, s/""/"/g, $_) : $_} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ALIASES] | |
diff=diff --diff-options '--strip-trailing-cr' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--type-add=php=.inc | |
--ignore-dir=log | |
--ignore-dir=logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); | |
my $document_root = $ENV{'DOCUMENT_ROOT'}; | |
my $addr = $ENV{'SERVER_ADDR'}; | |
my $v = sha1_hex($document_root,$addr); | |
if ($v ne '01f9ee68866f973e95c6c379afa9ab6e4a7a4395') { | |
print "Content-type: text/plain\n\n"; | |
print "hehehe\n"; | |
exit; |
OlderNewer