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 でこんにちは!"
@nobuoka
nobuoka / JavaAptPlugin.groovy
Last active September 28, 2017 09:23
Java Annotation Processing Task for Gradle
// buildSrc/src/main/groovy/JavaAptPlugin.groovy
class JavaAPT extends DefaultTask {
private File _destinationDir
def getDestinationDir(dir) { _destinationDir }
void setDestinationDir(dir) {
_destinationDir = dir
outputs.dir _destinationDir
}
@nobuoka
nobuoka / build.gradle
Last active August 6, 2018 10:49
Android アプリ開発における複数スレッドでの SQLite 使用に関する調査。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
tasks.withType(JavaCompile) {
@nobuoka
nobuoka / java-for-android-app.markdown
Last active May 10, 2024 08:02
Android アプリ開発勉強会のために書いた Java の入門文書

Android アプリ開発のための Java 入門

MEMO

  • declaration は 「宣言」 と訳しているが、「定義」 の方が適しているような気がしなくもない。
  • 「インスタンス」 と 「オブジェクト」 という言葉を使うことがあるが、本文書中ではどちらも同じ意味で使用している。
  • String オブジェクト」 という表現は、「String クラスのインスタンス」 を意味している。 (Java に限らず一般的な表現だと思う。)

はじめに

@nobuoka
nobuoka / gist:6460909
Created September 6, 2013 08:11
Perl 5.8.8 で Text::MeCab をインストールしようとするとエラーが出る
Text-MeCab-0.20014$ make
cc -c "-I." "-I/usr/include" "-I." -fPIC -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DMECAB_MAJOR_VERSION=0 -DMECAB_MINOR_VERSION=97 -I src -Wall -W -Wno-comment -O2 -DVERSION=\"0.20014\" -DXS_VERSION=\"0.20014\" -o xs/MeCab.o -fpic "-I/home/nobuoka/perl5/perlbrew/perls/perl-5.8.8/lib/5.8.8/x86_64-linux/CORE" -DUSE_PPPORT -DTEXT_MECAB_ENCODING='"euc-jp"' -DTEXT_MECAB_CONFIG='"/usr/bin/mecab-config"' xs/MeCab.c
xs/MeCab.xs:64: warning: excess elements in struct initializer
xs/MeCab.xs:64: warning: (near initialization for ‘TextMeCab_vtbl’)
xs/MeCab.xs: In function ‘XS_Text__MeCab_version’:
xs/MeCab.xs:116: warning: assignment discards qualifiers from pointer target type
xs/MeCab.c: In function ‘boot_Text__MeCab’:
xs/MeCab.c:1140: error: ‘MECAB_ONE_BEST’ undeclared (first use in this function)
xs/MeCab.c:1140: error: (Each undeclared identifier is reported only once
xs/MeCab.c:1140: error: for each functio
@nobuoka
nobuoka / bootstrap.js
Last active April 29, 2016 08:43
ブートストラップ型の XUL ベースの Firefox 拡張としてのサンプル。
var Cc = Components.classes;
var Ci = Components.interfaces;
var PromptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
// インストール時に呼び出される
function install(aData, aReason) {
PromptService.alert(null, "Bootstrapped Extension Sample", "Install");
}
" filetype が typescript の場合にのみ動作する neocomplcache プラグイン
" jsx_complete.vim を参考にしてます.
" https://github.com/osyo-manga/neocomplcache-jsx/blob/master/autoload/neocomplcache/sources/jsx_complete.vim
let s:source = {
\ 'name': 'typescript_complete',
\ 'kind': 'ftplugin',
\ 'filetypes': { 'typescript': 1 },
\ }
@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": [
]
@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 するなりして使用してください.
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