Skip to content

Instantly share code, notes, and snippets.

View nobuoka's full-sized avatar

Nobuoka Yu nobuoka

View GitHub Profile
@nobuoka
nobuoka / typetalk_post.groovy
Last active August 29, 2015 13:57
Typetalk のトピックに投稿する Groovy のサンプルコード
// clientId や clientSecret、topicId を設定して、groovy コマンドでこのファイルを実行すれば動きます。 (指定のトピックに投稿されます。)
// このサンプルコードはコピペ等でご自由にお使いください。 (問題が発生しても責任は負いかねます。)
String clientId = "XXXX"
String clientSecret = "XXXX"
// 投稿先トピックの ID
String topicId = "XXXX"
// 投稿するメッセージ
String message = "Groovy でこんにちは!"
$ proxychains ssh xxx.xxx
ProxyChains-3.1 (http://proxychains.sf.net)
|DNS-request| xxx.xxx
|S-chain|-<>-127.0.0.1:1080-<><>-X.X.X.X:XX-<><>-OK
|DNS-response|: xxx.xxx is not exist
ssh: Could not resolve hostname xxx.xxx: Unknown error
@nobuoka
nobuoka / eclipse_setup.markdown
Last active August 29, 2015 14:27
Eclipse setup for Java EE development

Eclipse のセットアップ

Windows で Java EE 開発をするための Eclipse の準備方法。

Eclipse のインストール

Eclipse のダウンロードページ より、「Eclipse IDE for Java EE Developers」 をダウンロードして展開する。

プラグイン

@nobuoka
nobuoka / eclipse_setup.markdown
Created August 16, 2015 09:59
Setup Eclipse for Scala development

Eclipse のセットアップ

Windows で Scala 開発をするための Eclipse の準備方法。

Eclipse および Scala IDE for Eclipse のインストール

Eclipse 本体

Eclipse のダウンロードページ より、「Eclipse IDE for Java Developers」 をダウンロードして展開する。

require 'pg'
# 接続先 DB の情報
DB_S_ARRAY = [ 'localhost', 5432, '', '', 'db_name', 'user_name', 'password' ]
# テーブル table_name に対して先にロックを獲得するスレッド
t1 = Thread.new do
dbconn = PGconn.connect( *DB_S_ARRAY )
dbconn.transaction do
puts 'locking table... (t1)'
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb
index 0d36c07..d6e88e5 100644
--- a/lib/webrick/httpresponse.rb
+++ b/lib/webrick/httpresponse.rb
@@ -330,13 +330,18 @@ module WEBrick
if @request_method == "HEAD"
# do nothing
elsif chunked?
- while buf = @body.read(@buffer_size)
- next if buf.empty?
@nobuoka
nobuoka / gist:2344397
Created April 9, 2012 15:55
Japanese translation for Rubinius
diff --git a/web/doc/ja/getting-started.markdown b/web/doc/ja/getting-started.markdown
index 9412036..c9f6de6 100644
--- a/web/doc/ja/getting-started.markdown
+++ b/web/doc/ja/getting-started.markdown
@@ -1,18 +1,17 @@
---
layout: doc_ja
-title: Getting Started
-previous: What is Rubinius?
+title: はじめに
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 54d36c9..cab9d92 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -1209,7 +1209,7 @@ strio_putc(VALUE self, VALUE ch)
/*
* call-seq:
- * strio.read([length [, buffer]]) -> string, buffer, or nil
+ * strio.read([length [, outbuf]]) -> string, outbuf, or nil
@nobuoka
nobuoka / twitter_list_adder.rb
Created April 22, 2012 05:59
Twitter のリストにユーザーを放り込む Ruby スクリプト
# coding: UTF-8
#==============================
# 指定した自分のリストに指定したユーザーを放り込みます.
# 多量のユーザーをリストに放り込みたいときに便利.
#==============================
# 本プログラムは OAuthSimple ライブラリを使用します.
# https://github.com/nobuoka/ruby-OAuthSimple
# で公開しているので, git clone するなりして使用してください.
@nobuoka
nobuoka / manifest.json
Created May 16, 2012 17:11
Chrome 拡張の popup 内で confirm を使うとおかしくなることがある
{
"name": "Extension for test",
"version": "1.0",
"manifest_version": 2,
"description": "for test of alert, confirm and prompt functions",
"browser_action": {
"default_popup": "popup.html"
},
"permissions": [
]