Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoshio HANAWA hnw

View GitHub Profile
View gist:367021
;; .emacs先頭で、.emacs.elcの方が古かったら再作成する。
;; (ってこのタイミングで再作成しても間に合わない気がする…。)
(if (file-newer-than-file-p "~/.emacs" "~/.emacs.elc")
(save-excursion
(byte-compile-file "~/.emacs")))
;; .emacsをsaveしたらelcを作る
(add-hook 'after-save-hook
(function (lambda ()
(if (string= (file-truename (expand-file-name "~/.emacs"))
View cocoa-emacs-inline-atok23.patch
*** lisp/term/ns-win.el.orig 2011-05-07 08:46:32.000000000 +0900
--- lisp/term/ns-win.el 2011-05-07 08:47:02.000000000 +0900
***************
*** 1530,1535 ****
--- 1530,1555 ----
(title . "半英")
(cursor-color)
(cursor-type))
+ ("com.justsystems.inputmethod.atok23.Roman"
+ (title . "A")
View access-private-method.php
<?php
/* requires PHP 5.3.2 */
class Foo
{
private function doSomethingPrivate($arg)
{
return 'foo'.$arg;
}
}
View fib.php
<?php
function fib ($n) {
$fib_internal = function ($n, $cur, $prev) use (&$fib_internal) {
if ($n === 0) { return $cur; }
return $fib_internal($n - 1, $cur + $prev, $cur);
};
return $fib_internal($n, 0, 1);
}
var_dump(fib(6)); // int(8)
View org.postfix.master.plist.diff.txt
*** /System/Library/LaunchDaemons/org.postfix.master.plist.orig 2011-09-01 11:51:26.000000000 +0900
--- /System/Library/LaunchDaemons/org.postfix.master.plist 2011-08-31 23:25:45.000000000 +0900
***************
*** 18,22 ****
--- 18,26 ----
</array>
<key>AbandonProcessGroup</key>
<true/>
+ <key>RunAtLoad</key>
+ <true/>
View apc-3.1.9-apc-fcntl-unlock-failed-patch.txt
*** APC-3.1.9/apc_lock.h.orig 2011-11-15 14:45:27.000000000 +0900
--- APC-3.1.9/apc_lock.h 2011-11-15 14:45:34.000000000 +0900
***************
*** 154,160 ****
# define apc_lck_nb_lock(a) apc_fcntl_nonblocking_lock(a TSRMLS_CC)
# define apc_lck_rdlock(a) apc_fcntl_rdlock(a TSRMLS_CC)
# define apc_lck_unlock(a) apc_fcntl_unlock(a TSRMLS_CC)
! # define apc_lck_rdunlock(a) apc_fcntl_unlock(&a TSRMLS_CC)
#endif
View bootstrap.php
<?php
function autoload($class) {
$file = str_replace('_','/',$class.'.php');
try{
include_once $file;
} catch (Exception $e) {
}
}
spl_autoload_register('autoload');
View RecentTest.php
<?php
/**
* Generated by PHPUnit_SkeletonGenerator on 2012-05-29 at 16:47:11.
*/
class RecentText extends PHPUnit_Framework_TestCase
{
/**
* @var Recent
*/
protected $object;
View sed-output.txt
$ sed --version
GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
$ sed -E 's/foo/bar/'
sed: invalid option -- E
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...
You can’t perform that action at this time.