This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Usage: gemspec [-s] GEMNAME | |
| # | |
| # Prints a basic gemspec for GEMNAME based on your git-config info. | |
| # If -s is passed, saves it as a GEMNAME.gemspec in the current | |
| # directory. Otherwise prints to standard output. | |
| # | |
| # Once you check this gemspec into your project, releasing a new gem | |
| # is dead simple: | |
| # |
This file contains hidden or 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
| #! /usr/bin/env ruby | |
| require "optparse" | |
| DEFAULT_OPTIONS = { | |
| :layout => File.expand_path("./textile2html_layout.html.erb", File.dirname(__FILE__)), | |
| :src_dir => File.expand_path("."), | |
| :dest_dir => File.expand_path("."), | |
| :noop => false, | |
| :verbose => false, | |
| } |
This file contains hidden or 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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <meta http-equiv="content-style-type" content="text/css" /> | |
| <meta http-equiv="content-script-type" content="text/javascript" /> | |
| </head> | |
| <body> | |
| <div style="float:right; font-size:x-small;max-width:40%;"> | |
| <%= yield(:page_outline) %> |
This file contains hidden or 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
| require 'fileutils' | |
| FileUtils.cp("config/database.yml", "config/database.yml.example") | |
| File.open(".gitignore", "a") do |f| | |
| f.puts "Gemfile.lock" | |
| f.puts ".rvmrc" | |
| end | |
| File.open("config/.gitignore", "a"){|f| f.puts("*.example")} | |
| gem 'factory_girl_rails', :group => [:development, :test] |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| require "rubygems" | |
| require "amqp" # requires version >= 0.8.0.RC14 | |
| puts "=> Example of automatic AMQP channel and queues recovery" | |
| puts | |
| AMQP.start(:host => "localhost") do |connection, open_ok| | |
| puts "AMQP.start block runs" | |
| # on_open, on_closedに渡されたブロックは、何度再接続をしても最初の一度だけしか呼び出されないが、 |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| base_dir = File.expand_path(".") | |
| base_stat = File.stat(base_dir) | |
| base_dir_permission = base_stat.mode & 0o777 | |
| base_file_permission = (base_stat.mode ^ 0o111) & 0o777 | |
| f = lambda do |confirmation| | |
| confirmation.puts "current directory: #{base_dir}" | |
| confirmation.puts "base_dir_permission : %o" % base_dir_permission |
This file contains hidden or 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
| インストールしたもの | |
| Emacs-24.3-universal-10.6.8.dmg | |
| GitX-L_v0.8.4.zip | |
| googlechrome.dmg | |
| GoogleJapaneseInput.dmg | |
| Skype_6.8.60.351.dmg | |
| xcode462_cltools_10_86938259a.dmg | |
| xcode4630916281a.dmg |
This file contains hidden or 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
| % mongo test | |
| MongoDB shell version: 2.4.6 | |
| connecting to: test | |
| > | |
| > db.t1.drop(); | |
| false | |
| > db.createCollection("t1", {}); | |
| { "ok" : 1 } | |
| > db.t1.ensureIndex({f1: 1}, {uniq: true}); | |
| > db.t1.ensureIndex({f1: 1}, {}); |
This file contains hidden or 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
| % mongo test --eval "db.d1.drop(); db.d1.insert({no: 1, d: new Date()})" && mongoexport -d test -c d1 | |
| MongoDB shell version: 2.4.6 | |
| connecting to: test | |
| connected to: 127.0.0.1 | |
| { "_id" : { "$oid" : "534e0af8532dbdbaa7c05783" }, "no" : 1, "d" : { "$date" : 1397623544193 } } | |
| exported 1 records |
This file contains hidden or 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
| http://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%94%E3%83%BC%E3%83%BB%E3%82%A2%E3%83%B3%E3%83%89%E3%83%BB%E3%83%9A%E3%83%BC%E3%82%B9%E3%83%88 |