Skip to content

Instantly share code, notes, and snippets.

@shigeyas
shigeyas / gist:3484965
Created August 27, 2012 01:52
crash dump using rubyracer-freebsd and libv8-freebsd
2003% cap deploy:update_code [development] ~/work/myapp
triggering load callbacks
* 10:48:08 == Currently executing `testing'
triggering start callbacks for `deploy:update_code'
* 10:48:08 == Currently executing `multistage:ensure'
* 10:48:08 == Currently executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote ssh://git-myapp@DB_HOST_NAME/home/git/myapp.git development"
command finished in 211ms
* executing "if [ -d /var/www/testing-myapp/shared/cached-copy ]; then cd /var/www/testing-myapp/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard hash_hash_hash && git submodule -q init && for mod in `git submodule status | awk '{ print $2 }'`; do git config -f .git/config submodule.${mod}.url `git config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && git submodule -q sync && export GIT_RECURSIVE=$([ ! \"`git --version`\" \\< \"git version 1.6.5
@shigeyas
shigeyas / gist:3446444
Created August 24, 2012 06:16
Excel macro to count cells in non-default color
Rem Excel Macro to
Rem count number of cells which assigned non-default colors
Rem ColorIndex for default color is magic number -4142
Rem
Rem Reminder: paste this into Worksheet's Module, save as .xls
Function CountAnyColor(rng)
CountAnyColor = 0
For Each c In rng.Cells
If c.Interior.ColorIndex <> -4142 Then
Subject: 混雑時のANA国内特典航空券を確実にGET!特典航空券を一般の人より先に予約出来る秘密とは…
★メルマガ解除リンク☆
<<URL>>
〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
貯めたマイルは、特典航空券に交換できますが…
家族旅行で利用する場合、家族がそろう時期は
@shigeyas
shigeyas / ckdl.rb
Created August 8, 2012 13:10
script to show list of days suitable for choseisan.com input
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# Create list of lines of days with day of week
# suitable for http://chouseisan.com input
#
require 'date'
day = Date.today
@shigeyas
shigeyas / gist:3197078
Created July 29, 2012 09:40
Error log related to Evernote on Mountain Lion
Jul 29 00:44:23 HOST_NAME_HERE mdworker32[5192]: Attempt to add read-only file at path file://localhost/Users/shigeya/Library/Application%20Support/Evernote/accounts/Evernote/shigeyas/Evernote.sql read/write. Adding it read-only instead. This will be a hard error in the future; you must specify the NSReadOnlyPersistentStoreOption.
@shigeyas
shigeyas / oo2text.rb
Created July 6, 2012 05:29
extract text part of OmniOutliner v3 file
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'optparse'
require 'nokogiri'
require 'zlib'
module OmniOutliner
class Document < Nokogiri::XML::SAX::Document
@shigeyas
shigeyas / gist:3057460
Created July 6, 2012 01:25
「中国で買ったマッサージタオルの注意書き」の文字化
「中国で買ったマッサージタオルの注意書き」の文字化
http://lockerz.com/s/165360335
[ALERT ICON] で注意 火災との直接接触しないでください
● この製品には、迅速に、汚れを削除
することができますし、お肌の新陳
代謝を促進する皮膚の健康を維持す
@shigeyas
shigeyas / setup-mount.sh
Created April 30, 2012 13:26
Script to create set up mount point on zfs on FreeBSD
# setup mount point
# based on: http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
RPOOL=rpool
ROOT=${RPOOL}/root
cd /
zfs set mountpoint=none ${RPOOL}
zfs set mountpoint=legacy ${ROOT}
@shigeyas
shigeyas / setup-zfs-root-filesystem.sh
Created April 30, 2012 06:49
Script to create set up root filesystem on zfs on FreeBSD
# Setup zfs root
# based on: http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
RPOOL=rpool
ROOT=${RPOOL}/root
cd /
zfs create -o compression=off -o exec=off -o setuid=off ${ROOT}/tmp
chmod 1777 /${ROOT}/tmp
@shigeyas
shigeyas / application.rb.diff
Created March 15, 2012 23:50
Configuration in config/application.rb which make asset pipeline happy
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end