Skip to content

Instantly share code, notes, and snippets.

View sakama's full-sized avatar
🎯
🍺

Satoshi Akama sakama

🎯
🍺
  • Treasure Data
  • Tokyo, Japan
View GitHub Profile
@sakama
sakama / rails_extjs_runtimeunavailable.log
Created January 10, 2012 07:16
Railsプロジェクトで(ExecJS::RuntimeUnavailable)が出た場合の対処
Gemfileに
gem 'therubyracer'
を記述
@sakama
sakama / each_with_index_offset.rb
Created January 16, 2012 06:44
each_with_indexにオフセットを渡す方法
[:foo, :bar, :baz].to_enum.with_index(1).each do |elem, i|
puts "#{i}: #{elem}"
end
1: foo
2: bar
3: baz
@sakama
sakama / gist:2018791
Created March 12, 2012 00:10
Emacsのelのリスト
elisp/anything-auto-install.el
elisp/anything-complete.el
elisp/anything-config.el
elisp/anything-etags.el
elisp/anything-exuberant-ctags.el
elisp/anything-gist.el
elisp/anything-grep.el
elisp/anything-gtags.el
elisp/anything-ipa.el
elisp/anything-match-plugin.el
@sakama
sakama / gist:2212804
Created March 27, 2012 05:31
mod_expireとmod_gzipでフロントエンドの高速化をするいつものアレ
#Expiredヘッダを付与する
ExpiresActive On
ExpiresByType text/css "access plus 14 days"
ExpiresByType application/javascript "access plus 14 days"
ExpiresByType application/x-javascript "access plus 14 days"
ExpiresByType text/javascript "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/x-icon "access plus 14 days"
@sakama
sakama / HyperEstraier_install.log
Created April 5, 2012 11:21
HyperEstraierインストールログ
libiconvのインストール
cd /usr/local/src
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure
make && make install
QDBMのインストール
@sakama
sakama / trackback.html
Created April 18, 2012 12:12
トラックバックを送信するためのHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>トラックバックテスト</title>
</head>
<body>
<h1>トラックバック送信テスト</h1>
<form action="" method="post">
@sakama
sakama / get_http_request.rb
Created September 13, 2012 08:37
ファイルからURLを読み込んでHTTP経由でリクエストを投げた結果を取得する Jmeterでもいいけどね...
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# ファイルから任意のURLを読み込んでHTTP経由でリクエストを投げた結果を取得する Jmeterでもいいけどね...
#
# 使用方法
# chmod a+x /path/to/get_http_request.rb
#
# 任意のディレクトリ
# ├get_http_request.rb
@sakama
sakama / gist:4083901
Created November 16, 2012 03:56
Jellyの<f:repeatable></f:repeatable>で追加・削除ボタンを出す
<f:section title="設定">
<f:entry field="envs" title="各設定">
<f:repeatable field="envs" minimum="0">
<table width="100%">
<f:entry field="envName" title="名前">
<f:textbox clazz="required"></f:textbox>
</f:entry>
<f:entry>
<div align="right">
<f:repeatableDeleteButton />
@sakama
sakama / gist:4085988
Created November 16, 2012 09:45
Jellyで任意のヘルプhtmlを表示する
<!--
設置対象のhtmlファイルはsrc/main/webapp/help-envName.htmlに設置する
-->
<j:set var="helpURL" value="/plugin/plugin_name/" />
<f:entry field="envName" title="名前" help="${helpURL}help-envName.html">
<f:textbox clazz="required"></f:textbox>
</f:entry>
@sakama
sakama / ec2_setup.rb
Created November 19, 2012 07:14
JenkinsからChef Server経由でEC2インスタンスを立ち上げるスクリプト
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
#ロールの決定(general|web|db)
role = ARGV[0]
if !role
role = 'general'
end
#AWSのリージョン