Skip to content

Instantly share code, notes, and snippets.

View tdtds's full-sized avatar
🐱
🐱

Tada, Tadashi tdtds

🐱
🐱
View GitHub Profile
// applicationCacheの更新を妨害する
Object.defineProperty(this,'applicationCache',{get:function(){return{}}});
(function () {
// AppCache上でlocation.hrefを読み込むとAppCacheの内容を読み込むため、「ブラウザは別URLと認識するが、サーバは同じコンテンツを返すURL」を作る
contentLoad(location.href+'/');
// 本来であればsubmit等のイベントもキャッチする必要がある
window.addEventListener('click', function (evn) {
var elem = evn.target;
while (elem.tagName.toLocaleLowerCase() != 'a') elem = elem.parentNode;
package configuration for libffi is not found
have_header: checking for ffi.h... -------------------- no
"gcc -E -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/fiddle -I/home/sho/.rbenv/versions/2.2.0/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -o conftest.i"
conftest.c:3:17: fatal error: ffi.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
/tmp/ruby-build.20141225191028.7198 ~/tmp
/tmp/ruby-build.20141225191028.7198/ruby-2.2.0 /tmp/ruby-build.20141225191028.7198 ~/tmp
config.guess already exists
config.sub already exists
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
@tdtds
tdtds / picasa_oauth.md
Last active August 29, 2015 14:22
PicasaWeb APIのOAuthがうまく使えないメモ

要件

  • 従来パスワード認証で使っていたpicasa gemを使いたい(OAuth対応してると書いてある)
  • アルバム作成、指定アルバムへの画像追加がしたい

やったこと

  • Google Developers Consoleでプロジェクトをひとつ作成
  • そのプロジェクトの「認証情報」でサービスアカウントを追加、ここでメールアドレス「hoge@developer.gserviceaccount.com」を得る
  • P12キーを生成してダウンロード(test.p12)
  • picasa gemに加えてgoogle-api-client gemをインストール
  • (以下はgoogle-api-clientとpicasaをrequireしたpry上で作業)
@tdtds
tdtds / mixi2gmail.diff
Created March 22, 2009 13:03
yoosee作mixi2gmailのバグfix差分
--- mixi2gmail.rb.20080404 2008-04-08 11:17:42.000000000 +0900
+++ mixi2gmail.rb 2009-03-22 14:11:33.000000000 +0900
@@ -34,7 +34,14 @@
rescue LoadError
end
require 'nkf'
+
require 'mechanize'
+require 'hpricot'
+begin
#!/home/sho/bin/ruby19
class Template
def initialize( &block )
@child = []
instance_eval( &block )
end
def result
@child.join( "\n" )
#!/bin/sh
#
# Copyright (c) 2010 Shinnosuke Suzuki <sasasin@sasasin.net>
# You can distribute this file under the GPL.
#
# Modified by TADA Tadashi <t@tdtds.jp>
#
FILE=$1
if [ -z $FILE ]; then
echo usage: pdf2kindle PDFfile [top bottom left right]
@tdtds
tdtds / OBSOLETE
Created December 8, 2010 22:16
getting MM9's text from webmysteries.jp.
#
# This command was obsolete. see also https://github.com/tdtds/aozoragen
#
#!/usr/bin/env ruby
#
# getting text from webmysteries.jp's novel.
#
require 'open-uri'
require 'nokogiri'
This project was moved to https://github.com/tdtds/kindlizer
@tdtds
tdtds / maouyusya2aozora.rb
Created December 21, 2010 09:29
まとめサイト上の「まおゆう」を青空文庫形式のテキストファイルに変換する
#!/usr/bin/ruby
# -*- coding: utf-8; -*-
#
require 'open-uri'
require 'nokogiri'
puts "魔王「この我のものとなれ、勇者よ」勇者「断る!」"
puts "橙乃ままれ"
puts "\n\n"