Skip to content

Instantly share code, notes, and snippets.

View takai's full-sized avatar

Naoto Takai takai

View GitHub Profile
#!/usr/bin/ruby
# -*- mode: ruby; encoding: utf-8-unix -*-
require 'tmpdir'
origdir = Dir::pwd
target = File.expand_path(ARGV[0])
dir = File::dirname(target)
rar = File::basename(target)
// ==UserScript==
// @name Remove HatenaBookmark Blockquote
// @namespace hatena
// @include http://b.hatena.ne.jp/*
// ==/UserScript==
var quotes = document.getElementsByTagName("BlockQuote")
for(var i = 0; i < quotes.length; i++) {
quotes[i].style.display = "none";
}
require 'rubygems'
require 'spec'
describe Spec do
before do
@object = Class.new {
def something?
true
end
}.new
Index: bcrypt_ext.c
===================================================================
--- bcrypt_ext.c (revision 41)
+++ bcrypt_ext.c (working copy)
@@ -10,13 +10,14 @@
/* Given a logarithmic cost parameter, generates a salt for use with +bc_crypt+.
*/
static VALUE bc_salt(VALUE self, VALUE cost, VALUE seed) {
- return rb_str_new2((char *)bcrypt_gensalt(NUM2INT(cost), (u_int8_t *)RSTRING(seed)->ptr));
+ return rb_str_new2((char *)bcrypt_gensalt(NUM2INT(cost), (u_int8_t *)RSTRING_PTR(seed)));
Index: ext/json/ext/generator/generator.c
===================================================================
--- ext/json/ext/generator/generator.c (revision 272)
+++ ext/json/ext/generator/generator.c (working copy)
@@ -1,6 +1,6 @@
#include <string.h>
#include "ruby.h"
-#include "st.h"
+#include "ruby/st.h"
#include "unicode.h"
diff --git a/merb-core/lib/merb-core/dispatch/request_parsers.rb b/merb-core/lib
/merb-core/dispatch/request_parsers.rb
index f04eb7a..071eb33 100644
--- a/merb-core/lib/merb-core/dispatch/request_parsers.rb
+++ b/merb-core/lib/merb-core/dispatch/request_parsers.rb
@@ -59,8 +59,8 @@ module Merb
status = input.read(boundary_size)
return {} if status == nil || status.empty?
raise ControllerExceptions::MultiPartParseError, "bad content body:\n'#{s
tatus}' should == '#{boundary + EOL}'" unless status == boundary + EOL
# -*- mode: ruby; coding: utf-8-unix -*-
Gem::Specification.new do |spec|
spec.name = "twitty-console"
spec.summary = "Console-based Twitter Client"
spec.version = "0.2.0"
spec.author = "Naoto Takai"
spec.email = "takai@recompile.net"
@takai
takai / init.el
Created March 4, 2009 00:10
rinari settings for emacs
;; Rinari
;(require 'ido)
;(ido-mode t)
(require 'rinari)
(require 'rhtml-mode)
(define-key rinari-minor-mode-map [(meta shift down)] 'rinari-find-rspec)
(define-key rinari-minor-mode-map [(meta shift left)] 'rinari-find-controller)
(define-key rinari-minor-mode-map [(meta shift up)] 'rinari-find-model)
(define-key rinari-minor-mode-map [(meta shift right)] 'rinari-find-view)
// ==UserScript==
// @name LDR繧「繝峨ヵ繧」繝シ繝峨r蜑企勁
// @namespace reader.livedoor.com
// @include http://reader.livedoor.com/reader/
// ==/UserScript==
(function () {
var head = document.getElementsByTagName('head')[0];
var style = document.createElement('style');
diff --git a/lib/twitty-console.rb b/lib/twitty-console.rb
index 363b537..8ee0cdf 100644
--- a/lib/twitty-console.rb
+++ b/lib/twitty-console.rb
@@ -21,4 +21,4 @@ require 'twitty-console/handler.rb'
require 'twitty-console/runner.rb'
require 'twitty-console/status.rb'
require 'twitty-console/proxy-patch.rb'
-
+require 'twitty-console/readline-patch.rb'