Skip to content

Instantly share code, notes, and snippets.

@yayugu
yayugu / gist:5902daaf6807a534d446
Last active August 29, 2015 14:17
雑なHDD監視crontab
33 * * * * sudo ruby -e 'zstat = `zpool status -x`.strip; if zstat != "all pools are healthy" then puts zstat; end'
35 * * * * sudo ruby -e '["sda", "sdb", "sdc", "sdd"].each do |dev| health = `smartctl -H /dev/#{dev}`; unless health.include?("SMART overall-health self-assessment test result: PASSED") then puts dev; puts health; end; end
@yayugu
yayugu / gist:007b9b5085513cb7f5d0
Created June 26, 2014 07:57
stylish's user script: github tab size 8 to 2
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(https://github.com/) {
.code-body .line, .file-diff .file-diff-line {
tab-size: 2;
-moz-tab-size: 2;
-o-tab-size: 2;
}
}
@yayugu
yayugu / gist:5983210
Last active October 29, 2020 18:19
卓球ハウスへのアクセス

住所

〒 153-0064 東京都目黒区下目黒5-11-24

行き方

best practice

グーグルマップ先生で経路から。現在地→東京都目黒区下目黒5-11-24

diff --git a/config.sample.yml b/config.sample.yml
index 0dab043..5ed6aa8 100644
--- a/config.sample.yml
+++ b/config.sample.yml
@@ -1,5 +1,5 @@
production:
- dsn: <%= ENV['DATABASE_URL'] || ENV['DUOSTACK_DB_MYSQL'] %>
+ dsn: mysql://sampleuser:samplepassword@localhost/db_name
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3

TwitterGoodRSS

TwitterGoodRSS is web service generate RSS better than Twitter official one.

Install

Heroku

@yayugu
yayugu / ybookML.y
Created July 24, 2011 04:29
ybookMLのパーサ
class YbookMLParser
prechigh
left CHARACTER
nonassoc LOW
preclow
rule
target : text { p val[0] }
| /* none */ { "" }
text : text string { result = val[0] + val[1] }
@yayugu
yayugu / gist:939522
Created April 24, 2011 12:40
Random#randとKernel#randでRangeを扱えるように
Random#randとKernel#randで引数としてRangeを扱えるようにしてほしいです。
Random#randは引数にInteger, Float, Rangeを扱うことができるのに対し、Kernel#rand, Random.randではIntegerしか扱うことができません。
rand 10 #=> 7
rand 7.5 #=> 4
rand 10..20 #=> TypeError: can't convert Range into Integer
Random.rand 10 #=> 8
Random.rand 7.5 #=> 3
@yayugu
yayugu / gist:640138
Created October 22, 2010 07:59
hogehiga's somen tairiku patch
Index: test/main/util/DefragUtilTest.java
===================================================================
--- test/main/util/DefragUtilTest.java (リビジョン 0)
+++ test/main/util/DefragUtilTest.java (リビジョン 5)
@@ -0,0 +1,75 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PTEX_IN_FILTER="/opt/local/bin/nkf -j"
# PROMPT
PS1="[@${HOST%%.*} %1~]%(!.#.$) " # この辺は好み
RPROMPT="%T" # 右側に時間を表示する
setopt transient_rprompt # 右側まで入力がきたら時間を消す
setopt prompt_subst # 便利なプロント
bindkey -e # emacsライクなキーバインド