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
> groonga -n --encoding sjis test.db |
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
#!/usr/bin/env ruby | |
require "readline" | |
require "tempfile" | |
if ARGV.size < 2 | |
$stderr.puts("Usage: #{$0} GROONGA_EXE DB_PATH") | |
exit(1) | |
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
#!ruby | |
#encoding = ARGV.shift | |
#args = ARGV.dup | |
#args.map! do |arg| | |
# arg.encode(encoding) | |
#end | |
#system(*ARGV) | |
encoding = ARGV.shift |
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 "ruby-poker" | |
class Player | |
attr_reader :name, :cards | |
attr_accessor :hand | |
def initialize(name) | |
@name = name | |
@cards = [] | |
@hand = nil | |
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
#!/usr/bin/env ruby | |
class Database | |
attr_reader :files | |
def initialize | |
@ii = {} | |
@files = [] | |
end | |
def add(path) |
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
#!/usr/bin/env ruby | |
require "groonga" | |
db_path = ARGV[0] || File.expand_path("~/.feedcellar/db/feedcellar.db") | |
Groonga::Database.open(db_path) do |database| | |
feeds = Groonga["Feeds"] | |
selected_feeds = feeds.select do |feed| | |
feed.title =~ /Ruby/ |
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
diff --git config.ru config.ru | |
index 1cbc50c..ba8ecbd 100644 | |
--- config.ru | |
+++ config.ru | |
@@ -21,6 +21,22 @@ lib_dir = File.join(base_dir, "lib") | |
$LOAD_PATH.unshift(lib_dir) | |
require "feedcellar/web/app" | |
+module Kaminari::Helpers | |
+ module SinatraHelpers |
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
#!/usr/bin/env ruby | |
output_path = "#{ARGV[0] || "out"}.flv" | |
info = `xwininfo -id $(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | grep -Eo "0x[0-9a-f]{2,}")` | |
x = info.scan(/Absolute upper-left X: *(\d+)/).first.last.to_i | |
y = info.scan(/Absolute upper-left Y: *(\d+)/).first.last.to_i | |
width = info.scan(/Width: *(\d+)/).first.last.to_i | |
height = info.scan(/Height: *(\d+)/).first.last.to_i |
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
$ ruby test_user.rb | |
Loaded suite test_user | |
Started | |
.. | |
Finished in 0.000777458 seconds. | |
------ | |
2 tests, 2 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications | |
100% passed | |
------ |
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
status | |
table_create --name Site --flags TABLE_HASH_KEY --key_type ShortText | |
select --table Site | |
column_create --table Site --name title --type ShortText | |
select --table Site |