Skip to content

Instantly share code, notes, and snippets.

@sue445
sue445 / multiline_grep.rb
Created August 22, 2012 02:30
空行で区切られた要素に対してgrepする
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
=begin
空行で区切られた要素に対してgrepする
=end
if ARGV.length < 2
puts "<usage> ruby multiline_grep.rb [search_file] [search_text1] [search_text2] ..."
exit
@gussan
gussan / gem_installer_eperm_patch.rb
Created November 7, 2012 08:21
Gem::InstallerでErrno::EPERM: Operation not permittedが出るときの逃げ道
# monkey patch for permission problem when installing package including executables from git repository
# (Errno::EPERM: Operation not permitted)
# for rubygems >= 1.8
# 1. put this file under lib directory.
# 2. put below line to top of Gemfile.
#
# require File.expand_path("lib/gem_installer_eperm_patch", File.dirname(__FILE__))
#
require 'rubygems/installer'
@gussan
gussan / diff
Created November 19, 2012 06:18
Fix ruby's uri parser to adapt subdomains including underscores
--- a/uri/common.rb
+++ b/uri/rfc3986_common.rb
@@ -45,9 +45,9 @@ module URI
RESERVED = ";/?:@&=+$,\\[\\]"
# domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- DOMLABEL = "(?:[#{ALNUM}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
+ DOMLABEL = "(?:[#{ALNUM}](?:[-_#{ALNUM}]*[#{ALNUM}])?)"
# toplabel = alpha | alpha *( alphanum | "-" ) alphanum
- TOPLABEL = "(?:[#{ALPHA}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
Application.configure do
config.after_initialize do
# Partialの情報をHTMLに埋める
# For ActionPack 3.2.8
class ActionView::PartialRenderer
def render_with_partial_annotation(*args)
setup(*args)
path = @path
content = "".html_safe
# config/environments/development.rb
# ActiveRecord 3.2.8 / mysql2 0.3.11
Application.configure do
config.after_initialize do
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
def execute_with_warning_is_error(sql, *rest)
result = execute_without_warning_is_error(sql, *rest)
warnings = execute_without_warning_is_error('show warnings', :skip_logging).to_a
@keiichironagano
keiichironagano / adventcal2015.md
Last active December 12, 2015 13:05
iTunes 使用許諾更新のとき一旦キャンセルしてほしい話
@vvakame
vvakame / to-java7.diff
Created February 20, 2013 03:43
Slim3プロジェクトをJava7で開発できるようにした。@zaki50 さんありがとう。 仕事のプロジェクトなので、全体貼るのがめんどくさいのでdiffだけぺとんちょ。
Date: Wed, 20 Feb 2013 12:40:23 +0900
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
appengine/pom.xml | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/appengine/pom.xml b/appengine/pom.xml
@kuenishi
kuenishi / Erlang_risk.md
Last active December 14, 2015 09:09 — forked from repeatedly/d_risk.md

ついに顕在化し始めてもいない「Erlang/OTPリスク」

英語圏ではかなり前からErlang/OTPを開発し続けることのリスクについて語られていたが,具体的な弊害が出て来たので,単なるメモ.日本では起こり得ない未来だと思う.

若手エンジニアの不足

COBOLのように需要が逼迫しているのに人材の供給が増えず需給ミスマッチが起っているわけでは無く,需要も供給も増えないという状況下でわずかながら需要が上回っている質の悪い状況がErlang/OTPに起きている.特に深刻なのは高価な若手エンジニアの採用が絶望的に難しいという現実だ.Haskellが台頭して数年経ちScalaがメインストリームの先頭を突っ走る2013年において全く別の関数型言語もどきを勉強しようとする若者はよほどの物好きしかいない.20~30歳のErlang/OTPエンジニアを雇うのはそれほど難しい上にコストがかかる.優秀な30代前半の若手エンジニアを雇いたいという企業の思いとは裏腹にErlang/OTP新たに学ぶ若者は絶滅寸前だ.

とても優秀な若手を雇用できるチャンスが巡って来た.採用担当者はこう尋ねる.「Erlang/OTPは習得していますか?」「もちろんRuby/Scalaはお手の物です.Haskellもある程度可能です」「もう一度伺いますがErlang/OTPまたはCは習得していますか?」「申し訳ございません 未習得です」

@grimrose
grimrose / TDDBC_Tokyo_2013_03_16.rst
Last active December 15, 2015 00:58
TDDBC東京 2013-03-16運営振り返り

Keep

  • 言語ごとにスケルトンを用意しておくと、それをダウンロードしてからスタート出来る。
    • IDEの違いが一番のネックになってくる。
    • キーバインドが違っているとペアが出来ない可能性がある。
    • GitHubなどで共有するのは妥当な解決策だが、参加者層によっては難しい。
  • 初心者同士のペアを作らないのは、良かった
@kawakawa
kawakawa / テスト駆動TDD (宇宙戦艦ヤマトの替え歌)
Created September 1, 2013 15:57
テスト駆動TDD (宇宙戦艦ヤマトの替え歌)
さらば不具合 輝く緑は
テスト駆動TDD
小さな機能 実装のため
テストを書いて 今始める
赤いバーを 緑にするため
ソースに書き込む 仮実装
緑を保ち リファクタリング
黄金の回転 テスト駆動TDD