Skip to content

Instantly share code, notes, and snippets.

View kyontan's full-sized avatar
♨️

kyontan kyontan

♨️
View GitHub Profile
@kyontan
kyontan / gist:8616088
Created January 25, 2014 13:06
CSS 溢れた文字列を"..."で省略
{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@kyontan
kyontan / Gemfile
Created December 23, 2013 09:58
Using rack-cache on Sinatra
gem "rack-cache", require: "rack/cache"
@kyontan
kyontan / gist:7678042
Last active January 8, 2025 13:55
游書体を加えたCSS font-family
/* ヒラギノ角ゴ */
font-family: "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
/* ヒラギノ明朝 */
font-family: "ヒラギノ明朝 Pro", "Hiragino Mincho Pro", "MS P明朝", "MS PMincho", serif;
/* From: 游明朝体・游ゴシック体のCSSでの利用 - Qiita [キータ]
* http://qiita.com/shinnn/items/5be7e8106189311559c1
*/
@kyontan
kyontan / gist:4093196
Created November 17, 2012 04:04
Sinatraメモ
helpers do
include Rack::Utils
alias_method :h, :escape_html
def csrf_token
Rack::Csrf.csrf_token(env)
end
def check_csrf
unless params[Rack::Csrf.csrf_field] == session['csrf.token']
@kyontan
kyontan / gist:3968745
Created October 28, 2012 14:29
Gnuplotめも
EPSに出力する場合
gnuplot > set terminal postscript enhanced eps (color)
gnuplot > set output '出力ファイル名'
gnuplot > (以降、プロットの操作)
度の扱いをラジアン⇒度数法へ
gnuplot> set degree angle
gnuplot> set logscale y
@kyontan
kyontan / sample.tex
Created October 28, 2012 14:24
Texメモ
%%A4で上下左右の余白を20mmにする
%% 高さの設定
\setlength{\textheight}{\paperheight} % ひとまず紙面を本文領域に
\setlength{\topmargin}{-5.4truemm} % 上の余白を20mm(=1inch-5.4mm)に
\addtolength{\topmargin}{-\headheight} %
\addtolength{\topmargin}{-\headsep} % ヘッダの分だけ本文領域を移動させる
\addtolength{\textheight}{-40truemm} % 下の余白も20mmに
%% 幅の設定
\setlength{\textwidth}{\paperwidth} % ひとまず紙面を本文領域に
@kyontan
kyontan / ruby_tips.rb
Created October 28, 2012 13:56
Rubyちょこまか
# ロードパスにカレントディレクトリを追加
$:.unshift File.dirname(__FILE__)
or
require './hoge.rb'
#true になる物を全て返す
String#scan
#Mechanizeでauthの警告を出さない
agent.add_auth(URI("http://example.com"),"username","password")