Skip to content

Instantly share code, notes, and snippets.

View smellman's full-sized avatar

Taro Matsuzawa aka. btm smellman

View GitHub Profile
@smellman
smellman / _autotest.rb
Created December 8, 2011 08:32
don't loop autotest
# file: .autotest
Autotest.add_hook :initialize do |at|
# don't look log/test.log
at.add_exception(%r{^\./log})
end
@smellman
smellman / gist:3385103
Created August 18, 2012 07:48
Preprocesser.py slashslash fixed
#original
def filter_slashslash(self, aLine):
[aLine, rest] = aLine.split('//', 1)
if rest:
aLine += '\n'
return aLine
#fixed
def filter_slashslash(self, aLine):
if (aLine.find('//') == -1):
return aLine
@smellman
smellman / patch.diff
Created October 3, 2012 15:16 — forked from tetsuharuohzeki/patch.diff
Preprocesser.py bug fix patch
# HG changeset patch
# Parent 635fcc11d2b16265114d6bbc02768d007f73d66b
# User Taro Matsuzawa <btm@tech.email.ne.jp>
diff --git a/config/Preprocessor.py b/config/Preprocessor.py
--- a/config/Preprocessor.py
+++ b/config/Preprocessor.py
@@ -377,16 +377,18 @@ class Preprocessor:
# Strips blank lines from the output.
def filter_emptyLines(self, aLine):
@smellman
smellman / build.sh
Created December 6, 2012 12:28
OpenSSLをiPhone向けにビルドしてみる(armv7)
# wget http://openssl.org/source/openssl-1.0.1c.tar.gz
# mkdir build config_temp tmp target
# SDKROOT=/Applications/Xcode4.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk ARCHS=armv7 BUILD_DIR=/Users/btm/tmp/openssl/build CONFIGURATION_TEMP_DIR=/Users/btm/tmp/openssl/config_temp TARGET_BUILD_DIR=/Users/btm/tmp/openssl/target PROJECT_TEMP_DIR=/Users/btm/tmp/openssl/tmp sh build.sh
#set | grep ARCH
#set -x
## Determine the appropriate openssl source path to use
## Introduced by michaeltyson, adapted to account for OPENSSL_SRC build path
# locate src archive file if present
@smellman
smellman / localwiki_api_sample
Created March 14, 2013 03:32
localwiki api sample
[/Users/btm] % irb
>> require 'cgi'
=> true
>> CGI.escape("ネットアクション")
=> "%E3%83%8D%E3%83%83%E3%83%88%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3"
コンテンツ取得
curl "http://localwiki.jp/api/page/?format=json&limit=0&page_tags__tags__slug__in=%E3%83%8D%E3%83%83%E3%83%88%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3"
地図取得
diff --git content/base/src/Makefile.in content/base/src/Makefile.in
index df6231c..2d076ca 100644
--- content/base/src/Makefile.in
+++ content/base/src/Makefile.in
@@ -193,6 +193,7 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/content/events/src \
-I$(topsrcdir)/content/html/content/src \
-I$(topsrcdir)/content/html/document/src \
+ -I$(topsrcdir)/content/svg/content/src \
-I$(topsrcdir)/content/xbl/src \
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4d8EuONtbrTMDWAXcVQ/Tr7ezOpnRNqo6D4hFSkyJDLHicITev0c7roR1/DWZ90gF1834tFAFggr9QlZ7ppEXzidSXfm1q7iS2UTKKQyoPNBNMKNfK+Jl+Nij0XTEfTNzNjGRxhtkAh9VU7d+rBO/9xfEoRxxgoGMQuX3G7Ym5LBP53rKan+51nFSWNwmqIV8Ktm5iK4AO77HKmMY20TGzeZ2LWepchqBKjGMFxKzuFKXd3zELv5cPhUOSIjMiGwe3kZzz4srvGrhaJhcHqTs8FTVqqpRR51D7OfMIL+N6NC3VR6XspMInHawk07NRoGpt5Eql3U43O2cKSQ3LxW/w== btm@wisp.local
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyiYjFoBjz17Cn/qE36bKTBgv9o2UmAcibCKPMSd8YCCTXaNmfgk6M2G3n6yNcSOekoftD5XT4ctoSBtnFTQOywpr1rbyPXk5mNmkT4r66uhxOQ79UE6laVbcxCeTqHcRtIhzO+1xbKil2RBI8FAiWaJ7th7gXvkzNb3e0WG1hw1c14BRiDt24ktxxQrZpbfrMMkU8kH4YWBynnEVhncpYn1NQX0wOUGeyU+xecy9yg4xn8uPekFYnEbqCAbrNs5LASOF/CvDQBAVMbfNJej3ZPSKaHoVCX+GvxaIBsaGMvYwv/8OPNU2cVcFZ5B79GBMOO/VPrVbuSiOnQ5KcGvxT btm@taro001.local
@smellman
smellman / extradeco.rb
Last active December 17, 2015 06:49
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/ Extra Decoratorで、Decoratorの連鎖をしてみたサンプル
require "delegate"
require "optparse"
# Socail Logic
class Facebook
def self.post(title, user)
p "post to facebook, title: #{title}, user: #{user}"
end
end
@smellman
smellman / private.xml
Created August 6, 2013 03:42
Thinkpad Keyboard 用の KeyRemap4MacBookの設定サンプル
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>Lenovo</vendorname>
<vendorid>0x17ef</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>THINKPAD_KEYBOARD</productname>
<productid>0x6047</productid>
@smellman
smellman / makesquare.sh
Created August 16, 2013 10:28
カレントディレクトリにあるJPEG画像を画像の中心から適当な大きさの正方形にする
for i in *.jpg; do; convert -resize '350x' -resize 'x350<' -gravity 'center' -crop '350x350+0+0' $i thum/$i; done