Skip to content

Instantly share code, notes, and snippets.

Hiroshi Kuwabara kuwabarahiroshi

Block or report user

Report or block kuwabarahiroshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kuwabarahiroshi / mov2gif
Last active Mar 14, 2019
Convert videos (.mov, .mp4, etc.) to animated GIF via command line. (on Mac)
View mov2gif
# install ffmpeg and gifsicle if not exists
which ffmpeg > /dev/null || brew install ffmpeg
which gifsicle > /dev/null || brew install gifsicle
usage () {
echo "Usage:" 1>&2
echo " mov2gif [-d delay] [-o 1|2|3] [-r frame_rate] [-w width] input_file" 1>&2
echo "" 1>&2
kuwabarahiroshi / Dockerfile
Created Feb 13, 2019 — forked from tylerchr/Dockerfile
Compiling V8 for alpine (link against musl)
View Dockerfile
# Building V8 for alpine is a real pain. We have to compile from source, because it has to be
# linked against musl, and we also have to recompile some of the build tools as the official
# build workflow tends to assume glibc by including vendored tools that link against it.
# The general strategy is this:
# 1. Build GN for alpine (this is a build dependency)
# 2. Use depot_tools to fetch the V8 source and dependencies (needs glibc)
# 3. Build V8 for alpine
kuwabarahiroshi / Gemfile
Created Dec 16, 2016
Optimize CarrierWave images using image_optim
View Gemfile
gem 'carrierwave'
gem 'image_optim_rails'
gem 'image_optim_pack'
kuwabarahiroshi / ApiDefinition.cs
Created Jun 12, 2014
ApiDefinition.cs for WebViewJavascriptBridge
View ApiDefinition.cs
using System;
using MonoTouch.ObjCRuntime;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace CocoaPods
delegate void WVJBResponseCallback (NSObject responseData);
delegate void WVJBHandler (NSObject data, [BlockCallback] WVJBResponseCallback responseCallback);
kuwabarahiroshi / setup-bare-repository-and-worktree
Created Jan 28, 2014
Gitのbare repositoryとworktreeを設定する一連のコマンド
View setup-bare-repository-and-worktree
mkdir project.git
cd project.git/
git init --bare
git --bare update-server-info
git config core.bare false
git config core.worktree /path/to/project
git config receive.denyCurrentBranch ignore
cat > hooks/post-receive
git checkout -f
kuwabarahiroshi /
Created Jan 20, 2014
Androidアプリをビルドするときにantを使って署名付APKを作成するシェルスクリプト。 brewでandroid-sdkをインストールしている前提です。 署名する際にkeystoreファイルのパスワードを求められますが、expectコマンドで自動化しています。
#! /bin/bash
expect -f - <<EOD
set timeout -1
set pass "YOUR-PASSWORD"
spawn ant -f build.xml clean release -Dsdk.dir=$(brew --prefix android-sdk)
expect "(store:production.keystore):" { send "\$pass\r" }
expect "Please enter password for alias 'mykey':" { send "\$pass\r" }
expect eof
kuwabarahiroshi /
Created Jan 20, 2014
Make standalone chrome app
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
echo "What is the url (e.g."
read inputline
kuwabarahiroshi / test.rb
Created Jan 16, 2014
SQL statement with subquery is consistent but not atomic.
View test.rb
#!/usr/bin/env ruby
require 'mysql2'
# config
host: 'localhost',
username: 'root',


kuwabarahiroshi / Makefile
Created Oct 22, 2013
iOSアプリのbuild -> TestFlightアップを自動化するMakefile
View Makefile
.PHONY: flight build
DATETIME = $(shell date '+%Y-%m-%d_%H%M%S')
BUILD = staging
xcodebuild -sdk iphoneos -target appname -configuration Production -scheme appname-production build
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion `git rev-list HEAD | wc -l`" appname/appname-Info.plist
You can’t perform that action at this time.