Skip to content

Instantly share code, notes, and snippets.

@sho-h
sho-h / redmine.changes.md
Last active September 25, 2018 12:24
Ruby level Redmine changes by yard diff(3.0.0 -> 3.4.6)
class/method path version action detail
AccountController#invalid_credentials app/controllers/account_controller.rb 3.3.0 modified compare url
AccountController#login app/controllers/account_controller.rb 3.2.7 modified compare url
AccountController#login app/controllers/account_controller.rb 3.3.0 modified compare url
AccountController#login app/controllers/account_controller.rb 3.4.0 modified compare url
AccountController#login app/controllers/account_controller.rb 3.3.4 modified [compare url](https://github.com/redmine/redmine/compare/3.3.3...3.3.4#dif
require "tempfile"
data = "test"
[:flush, :fsync, :fdatasync].each do |method|
puts "---- #{method} ----"
res = []
10.times do
Tempfile.open("testtmpfile") do |f|
before = Time.now
10000.times do |i|
@sho-h
sho-h / Gemfile.local
Last active June 15, 2017 00:38
gemify redmine plugins.
plugins = [
['redmine_audit'],
# ['foo', '>= 1.0.0'],
# ...
]
Gem.post_install do |installer|
require 'rubygems/user_interaction'
suffix = '.from_gemfile'
gem_name = installer.spec.name
@sho-h
sho-h / TroubleList.md
Created October 26, 2015 05:43
TroubleList.md

RailsGirls向け

前提条件

  • TODO

問題一覧

ガイド 場所 RailsGirl向けIssue 解決策
#!/bin/sh
export PATH="/usr/local/bin/:$PATH"
eval "$(rbenv init - zsh)"
# Syntax check
ruby -w -c $1
rc_exitcode=$?
# Brakeman vulnerability check
@sho-h
sho-h / gist:ed24a80cdb2cf21d5c12
Created January 21, 2015 00:23
Fix File#birthtime and File.birthtime on Windows
Index: file.c
===================================================================
--- file.c (revision 49353)
+++ file.c (working copy)
@@ -2193,10 +2193,10 @@
*
* _file_name_ can be an IO object.
*
- * Note that on Windows (NTFS), returns creation time (birth time).
- *
@sho-h
sho-h / 2013-01-29-mogok.markdown.patch
Last active December 26, 2015 01:19
http://railsgirls.jp/mogok/ で assets が動的コンパイルされるように修正。ただし、スクリーンショットの追加は行えていない。
--- a/_posts/2013-01-29-mogok.markdown
+++ b/_posts/2013-01-29-mogok.markdown
@@ -49,10 +49,18 @@ Gemfileに以下のGemが記述されていない場合には追記します。(
`config.serve_static_assets = false`
+ `...`
+
+ `config.assets.compile = false`
+
@sho-h
sho-h / members.yml.patch
Created October 4, 2013 05:34
add @ToruKurahashi to matsuerb-nanoc
--- a/resources/members.yml
+++ b/resources/members.yml
@@ -60,6 +60,13 @@
:profile: Matsue.rb に参加している松江市在住のITエンジニア。主に使用している
のはRubyとJavaScript。
:gravatar_hash: ed009bd803ad84352205f2eb4a978cb5
:public: true
+- :name: Toru Kurahashi
+ :github: ToruKurahashi
+ :twitter: torukurahashi
@sho-h
sho-h / gist:5022808
Last active December 14, 2015 03:39
Module#refine rurema description
引数 klass で指定したクラスだけに対して、ブロックで指定した機能を提供で
きるモジュールを定義します。定義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。
そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。
refinements 機能の詳細については以下を参照してください。
#@# TODO: るびまへのリンク(記事があれば)も併せて追記
* [[url:http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/doc/syntax/refinements.rdoc?view=markup]]
* [[url:http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec]]
@sho-h
sho-h / update.sh.diff
Created August 24, 2012 16:57
generate HTML with japanese catalog
--- update.sh.orig 2012-08-25 01:55:19.936317162 +0900
+++ update.sh 2012-08-25 01:55:56.512216058 +0900
@@ -66,7 +66,8 @@
--quiet \
--fs-casesensitive \
--database ${base_dir}/db-${version} \
- --outputdir ${base_dir}/public/${version}.new
+ --outputdir ${base_dir}/public/${version}.new \
+ --catalog ${bitclust_dir}/data/bitclust/catalog
mv ${base_dir}/public/${version}{,.old}