Skip to content

Instantly share code, notes, and snippets.

@uasi
uasi / brew-install-version.sh
Created June 25, 2012 07:30
brew install-version (a Homebrew command that install a specific version of a formula with ease)
#!/usr/bin/env zsh
if [[ $# -lt 2 ]]; then
print -P "%UUsage%u: brew install-version [install options] FORMULA VERSION"
exit 1
fi
formula=
version=
install_opts=()
@unak
unak / history.txt
Last active November 29, 2021 01:40
The History of Ruby
* Only the releases of the stable versions are listed in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also listed. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release because of an accident.
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities, the mi
@todesking
todesking / svn-cherry-pick.rb
Created August 3, 2012 11:26
svn-cherry-pick
#!/usr/bin/env ruby
# -*- coding:utf-8 -*-
raise <<EOS
MOVED: https://github.com/todesking/svn-cherry-pick
EOS
@y-yu
y-yu / inherit.md
Created August 9, 2012 06:57
JavaScriptの継承について

JavaScriptの継承について

全然理解出来てなかったので調べてみた。

経緯

function f () {
	// Class
}
@mazgi
mazgi / zusaar_users_to_csv.rb
Created August 14, 2012 04:57
https://gist.github.com/2787140 とほぼ一緒。あとで整理する
#!/usr/bin/env ruby
require 'pp'
require 'optparse'
require 'net/http'
require 'json'
Version=0.5
class User
attr_accessor :atnd_name, :is_regular
@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}])?)"
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
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