Skip to content

Instantly share code, notes, and snippets.

@tomykaira
tomykaira / bottom_right.html
Created May 22, 2011 15:39
jQUI: New test for #4316.
<html>
<head>
<title>scaling test</title>
<script type="text/javascript" src="../../jquery-1.5.1.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="../../ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.effects.scale.js"></script>
<html>
<head>
<script type="text/javascript" src="../../jquery-1.5.1.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="../../ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.effects.scale.js"></script>
<script type="text/javascript" src="../../ui/jquery.effects.blind.js"></script>
#!/usr/bin/env ruby
require "socket"
require "rubygems"
require "twitter"
require 'oauth'
require 'pp'
# Don't allow use of "tainted" data by potentially dangerous operations
$SAFE=1
@tomykaira
tomykaira / smarttabs.el
Created June 3, 2011 13:45 — forked from jacius/smarttabs.el
Emacs smart tabs - indent with tabs, align with spaces!
;;
;; Emacs smart tabs functionality
;; Intelligently indent with tabs, align with spaces!
;;
;; Note: Indenting only uses tabs when indent-tabs-mode is non-nil,
;; otherwise it uses spaces as usual.
;;
;; To use: save as smarttabs.el in your .emacs.d directory, and add
;; "(require 'smarttabs)" to your .emacs file.
;;
@tomykaira
tomykaira / org-to-hatena.el
Created June 13, 2011 02:47
convert Org-mode file to hatena like
(defun org-to-hatena (begin end)
(interactive "r")
(if (and transient-mark-mode (not mark-active))
(setq begin (point-min)
end (point-max)))
(save-excursion
(goto-char begin)
;; if the first heading is ** (not *)
(re-search-forward "^\\*\\*?" end nil)
@tomykaira
tomykaira / platex-utf.sh
Created June 28, 2011 01:49
Ubuntu 標準の、 EUC にしか対応していない pTeX を UTF-8 環境で動作させます。
function platex-utf(){
nkf -e $1 > /tmp/`basename $1`
cocot -t UTF-8 -p EUC-JP -- \platex /tmp/`basename $1`
}
@tomykaira
tomykaira / node-iconv-build.log
Created July 3, 2011 00:58
node-iconv build log on Solaris (JoyentCloud)
cd deps/libiconv-1.13.1 && ./configure --disable-shared --enable-static --enable-relocatable --enable-extra-encodings
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
module Authentication
class Unauthorized < StandardError; end
def self.included(base)
base.send(:include, Authentication::HelperMethods)
base.send(:include, Authentication::ControllerMethods)
ActiveSupport.on_load(:action_controller) do
helper_method :current_fb
@tomykaira
tomykaira / shape.lhs
Created July 24, 2011 08:02
#start_haskell サンプルプログラム1
Shape: データ名
Rectangle: constructor
先頭がおおもじなのは型クラス名です
> data Shape = Rectangle Float Float
> | Square Float
> | Circle Float
> | Triangle Float Float
これについての関数を定義
module Main where
-- モナド: 型構成子、 return、 バインド
data Position t = Position t deriving (Show) -- 型構成子、 自家製モナド
stagger (Position d) = Position (d + 2)
crawl (Position d) = Position (d + 1)
rtn x = x -- return のかわり
x >>== f = f x -- bind(>>=) のかわり
treasureMap pos = pos >>==