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
% 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 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 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
kerl build R15B01 r15b01-01 |
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
$ sw_vers | |
ProductName: Mac OS X | |
ProductVersion: 10.9.3 | |
BuildVersion: 13D65 |
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(recursive). | |
-export([split/2]). | |
-export([fib/1]). | |
split(D, L) -> split(D, L, [], []). | |
split(_, [] , R, W) -> [lists:reverse(X) || X <- lists:reverse([W|R])]; | |
split(D, [D|T], R, W) -> split(D, T, [W|R], []); | |
split(D, [H|T], R, W) -> split(D, T, R, [H|W]). | |
fib(0) -> 0; |
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
def sq_escape(str) | |
str.split(/\'/).map{|s| "'#{s}'"}.join("\\'") | |
end | |
sq_escape {"breakfast"=>"Bill's"}.to_json | |
#=> "'{\"breakfast\":\"Bill'\\''s\"}'" | |
puts sq_escape {"breakfast"=>"Bill's"}.to_json | |
#=> '{"breakfast":"Bill'\''s"}' | |
# # on bash | |
# $ echo '{"breakfast":"Bill'\''s"}' |
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
The original is https://about.gitlab.com/2015/04/08/the-remote-manifesto/ | |
We all have been greatly helped by Scrum and the Agile manifesto. | |
It freed us from waterfall planning and excessive process. But working | |
remotely and continuous delivery need something more. | |
私達は皆Scrumとアジャイルマニフェストに救われてきました。 | |
それはウォーターフォールの計画ややり過ぎたのプロセスから私達を開放してくれました。 | |
しかし、リモートでの働き方や継続的デリバリにはまだ何か必要なのです。 |
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
require 'java' | |
require 'poi-3.1-FINAL-20080629.jar' | |
class RubyOutputStream < java.io.OutputStream | |
def set_io(io) | |
@io = io | |
end | |
def write(b) | |
if b.is_a?(Fixnum) |
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
require 'java' | |
require 'poi-3.1-FINAL-20080629.jar' | |
java.io.FileOutputStream.new("test2.xls") do |io| | |
wb = org.apache.poi.hssf.usermodel.HSSFWorkbook.new | |
wb.createSheet("First") | |
wb.write(io) | |
end |
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
class Module | |
def tree_ancestors | |
puts_tree_acestors(0, [self]) | |
end | |
protected | |
def puts_tree_acestors(indent, displayed_modules) | |
puts "%s[%s] %s" % [' ' * indent, (self.is_a?(Class) ? 'C' : 'M'), self.name] | |
nested_included_modules = included_modules.map{|mod| mod.included_modules}.uniq.flatten # - displayed_modules | |
my_included_modules = included_modules - nested_included_modules |
OlderNewer