This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RandomJapanese | |
KANJI_LOWER_RANGE = 0x4E00 | |
KANJI_UPPER_RANGE = 0x9FBF | |
HIRAGANA_LOWER_RANGE = 0x3040 | |
HIRAGANA_UPPER_RANGE = 0x309F | |
KATAKANA_LOWER_RANGE = 0x30A0 | |
KATAKANA_UPPER_RANGE = 0x30FF | |
class << self | |
def kanji(length = 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Autotest::Screen is test result notify GNU Screen's statusline. | |
# | |
# === screenshots | |
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015543.png" /> | |
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015522.png" /> | |
# | |
# == SYNOPSIS | |
# require 'autotest/screen' | |
# # Autotest::Screen.statusline = '%H %`%-w%{=b bw}%n %t%{-}%+w (your statusline)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set YAML output of String values in hashes to be double quoted | |
# Only modifies hashes that are about to run to_yaml | |
require 'yaml' | |
class Hash | |
def to_yaml_with_quoted_strings(*args) | |
class << self | |
unless method_defined?(:each_with_quoted_strings) | |
def each_with_quoted_strings | |
each_with_normal_strings do |k,v| | |
if String === v && !v.frozen? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ [[ -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ 4 -gt 0 ]] | |
+ rvm_token=install | |
+ shift | |
+ case "$rvm_token" in | |
+ rvm_action=install | |
+ [[ -z install ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
======================================================= | |
39606 [Feature:trunk] Dir instance methods for relative path | |
======================================================= | |
[ruby-dev:39606] Nobu suggests having an instance method on Dir for accessing relative paths, with an implementation in the mvm branch. He came up with this idea after reading Akira TANAKA's article on handling temporary files and symlink attacks (http://www.ipa.go.jp/security/fy20/reports/tech1-tg/2_05.html). Example usage: | |
$ ./ruby -v -e 'p Dir.open("ext"){|d|d.open("extmk.rb"){|f|f.gets}}' | |
ruby 1.9.1 (2008-12-25 mvm 20976) [i686-linux] | |
"#! /usr/local/bin/ruby¥n" | |
$ mkdir tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This example shows how to setup an environment running Rails 3 beta2 under 1.9.2-head (mput) with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install mput-head | |
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist. | |
∴ rvm --create use mput-head@rails3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In $HOME/.rvm/user/db | |
ruby_configure_flags=--enable-shared --with-readline-dir=$HOME/.rvm/usr --with-iconv-dir=$HOME/.rvm/usr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ja: | |
errors: | |
messages: | |
not_found: "は見つかりませんでした" | |
# not_found: "not found" | |
already_confirmed: "は既に登録済みです" | |
# already_confirmed: "was already confirmed" | |
not_locked: "は凍結されていません" | |
# not_locked: "was not locked" | |
not_saved: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Country Stores Population Population per Store | |
USA 236 308 million 1.3 million | |
UK 29 62 million 2.1 million | |
Canada 19 34 million 1.7 million | |
Australia 10 22 million 2.2 million | |
Japan 7 127 million 18 million | |
China 4 1,339 million 334 million | |
France 6 65 million 10.8 million | |
Germany 5 81 million 16 million | |
Italy 4 60 million 15 million |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Ruby Gems available on Try Jupyter" | |
] | |
}, | |
{ |
OlderNewer