Skip to content

Instantly share code, notes, and snippets.

View henry0312's full-sized avatar
💭
I may be slow to respond.

OMOTO Tsukasa henry0312

💭
I may be slow to respond.
View GitHub Profile
@henry0312
henry0312 / fizz_buzz.rb
Created August 22, 2011 16:00
FizzBuzz Question
def fizz_buzz(n)
1.upto(n) do |i|
if i % 15 == 0 then
print "FizzBuzz\n"
elsif i % 3 == 0 then
print "Fizz\n"
elsif i % 5 == 0 then
print "Buzz\n"
else
print i, "\n"
@henry0312
henry0312 / fix-for-building-with-xcode4.patch
Created August 28, 2011 06:16
Fix for building with Xcode 4
diff --git a/src/ChangeLog b/src/ChangeLog
index b158eaf..d3d61a8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * unexmacosx.c (copy_data_segment): Also copy __got section.
+ (Bug#8223)
+
@henry0312
henry0312 / emacs-23.3a-for-lion.patch
Created August 28, 2011 06:20
Add features for Lion to Emacs 23.3a
diff --git a/src/nsterm.m b/src/nsterm.m
index 30b73c2..6597790 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4488,7 +4488,7 @@ ns_term_shutdown (int sig)
code, fnKeysym, flags, emacs_event->modifiers);
/* if it was a function key or had modifiers, pass it directly to emacs */
- if (fnKeysym || (emacs_event->modifiers
+ if (fnKeysym || (emacs_event->modifiers && (emacs_event->modifiers != shift_modifier)
@henry0312
henry0312 / eptex2pdf-utf8
Created September 25, 2011 07:45
TeX scripts
#!/bin/sh
# iNoue Koich! (modified by S. Zenitani)
export PATH=$PATH:/usr/texbin:/usr/local/bin
COMMAND=${0##*/}
PTEX=${COMMAND%2pdf-*}
ENCODE=${COMMAND#*-}
JOBNAME=${1##*/}
JOBNAME=${JOBNAME%.*}
@henry0312
henry0312 / yatex_makefile.diff
Created September 25, 2011 11:33
YaTeX makefile diff
--- makefile.orig 2012-01-12 11:41:02.000000000 +0900
+++ makefile 2012-01-16 14:50:51.000000000 +0900
@@ -3,14 +3,14 @@
#
# Edit these variables to be suitable for your site
-PREFIX = /usr/local
+PREFIX = /Users/henry/.emacs.d
## mule2
@henry0312
henry0312 / gist:1240549
Created September 25, 2011 12:14
.emacs for YaTeX
;; YaTeX
(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
(setq load-path (cons (expand-file-name "/Users/henry/.emacs.d/site-lisp/yatex") load-path))
(setq tex-command "~/Library/TeXShop/bin/platex2pdf-utf8" ; eucの場合はplatex2pdf-euc
dvi2-command "open -a Preview") ; Preview.appを使ってPDFを開く
(setq YaTeX-kanji-code 4) ; (setq YaTeX-kanji-code nil)の方がいいかもしれない。
@henry0312
henry0312 / gcc_libs.sh
Created November 27, 2011 06:12
Tools/packages necessary for building GCC
#!/bin/sh
# Prerequisites for GCC
# http://gcc.gnu.org/install/prerequisites.html
# 初期設定
WORK=$HOME/Builds/GCC/libs
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
@henry0312
henry0312 / gcc.sh
Created November 27, 2011 06:17
Build GCC on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/GCC
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
@henry0312
henry0312 / mingw.sh
Created November 27, 2011 06:19
Build MinGW Cross Compiler on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/GCC
PREFIX=$HOME/mingw
export PATH="$HOME/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
@henry0312
henry0312 / build-essential.sh
Created November 27, 2011 07:17
Build m4, autoconf, automake, libtool on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/build-essential
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src