Skip to content

Instantly share code, notes, and snippets.

@tanaka51
tanaka51 / error
Created December 16, 2011 05:05
Ruby 1.9.3-p0, Rails 3.1.3, bundle install で発生
$ gem install mysql2 -v '0.3.11' git:master*
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/koichi/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
@tanaka51
tanaka51 / gist:1598915
Created January 12, 2012 05:14
Passenger error on CentOS 5.6, Apache2
[Wed Jan 11 01:59:59 2012] [error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog: it seems to have crashed during startup for an unknown reason, with exit code 1
[Wed Jan 11 01:59:59 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 11 01:59:59 2012] [notice] Digest: done
[ pid=16082 thr=3086060128 file=ext/apache2/Hooks.cpp:1378 time=2012-01-11 01:59:59.922 ]: Initializing Phusion Passenger...
[ pid=16084 thr=3086673616 file=ext/common/Watchdog.cpp:1073 time=2012-01-11 01:59:59.927 ]: Cannot change the directory '/tmp/passenger.1.0.16082/generation-0/buffered_uploads' its UID to 48 and GID to 48: Operation not permitted (1)
in 'void Passenger::ServerInstanceDir::Generation::create(bool, const std::string&, const std::string&, uid_t, gid_t)' (ServerInstanceDir.h:76)
@tanaka51
tanaka51 / rspec-syntax-cheat-sheet.rb
Created April 26, 2012 10:13 — forked from irohiroki/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@tanaka51
tanaka51 / shibuya-el-position-paper.md
Created August 24, 2012 00:26 — forked from ainame/shibuya-el-position-paper.md
shibuya.elのポジションペーパーです。githubアカウントをお持ちの方はforkしてお使いください。

Shibuya.el#1 ポジションペーパー

Personal

  • 名前(任意)

    • 田中 光一
  • Twitter

  • @tanaka51

@tanaka51
tanaka51 / get_emoj.js
Created October 2, 2012 07:40
Getting emoji code from using on http://www.emoji-cheat-sheet.com/
var emojis = "";
$('span.emoji').each(function(){
emojis = emojis + " " + $(this).parent().text();
});
alert(emojis);
@tanaka51
tanaka51 / get_emoj.js
Created October 2, 2012 07:55
Getting emoji-code and img from using on http://www.emoji-cheat-sheet.com/
var url = "http://www.emoji-cheat-sheet.com/"
var imgs_code = "";
$('span.emoji').each(function(){
imgs_code = imgs_code + "\n" + url + $(this).data('src') + " - " + $(this).parent().text();
});
alert(imgs_code);
@tanaka51
tanaka51 / pr.md
Created April 22, 2013 10:29 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tanaka51
tanaka51 / find-cp
Created June 21, 2013 09:34
find-cp png jpg -o ~/path/to/directory
#!/usr/bin/env ruby
require 'fileutils'; include FileUtils
require 'optparse'
dest_path = ""
noop = ""
opt = OptionParser.new
opt.on('-o VAL') {|v| dest_path = v }
opt.on('-d', '--dry-run') {|v| noop = v }
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000101585181, pid=636, tid=3871
#
# JRE version: 7.0_25-b15
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x2a7181]
#
@tanaka51
tanaka51 / mugicha.el
Last active December 22, 2015 10:28
Emacs meets tmux!
;;; mugicha.el --- Emacs meets tmux!
;; Author: Koichi TANAKA <[email protected]>
;; This file is *NOT* part of GNU Emacs.
;;; Code:
(eval-when-compile (require 'cl))
(defgroup mugicha nil