Skip to content

Instantly share code, notes, and snippets.

View Nyoho's full-sized avatar
:octocat:
GitHubing

北䑓如法 Nyoho

:octocat:
GitHubing
View GitHub Profile
@Nyoho
Nyoho / Many_to_something.user.js
Created February 23, 2012 11:35
"many" to "something"
// ==UserScript==
// @name Many to something
// @namespace http://kita.dyndns.org/
// @description いっぱいに対して何かをします。
// @include http://*
// @include https://*
// @exclude https://mail.google.com/*
// ==/UserScript==
function manyToSomething(){
@Nyoho
Nyoho / urlinfo-safari2org-mode
Created August 27, 2012 06:36
Safari で開いているページのタイトルとURLを org-mode 形式でさくっとコピー
-- Generate a link text in org-mode style and copy it to clipboard
tell application "Safari"
set theTitle to do JavaScript "document.title" in front document
set theURL to URL of front document
end tell
set the clipboard to "[[" & theURL & "][" & theTitle & "]]"
@Nyoho
Nyoho / gist:5018563
Created February 23, 2013 05:12
rbenv で新しいバージョンをインストールしてついでに gem もごっそり移行する。zsh の補完も効くようにしてみた。.zshrc の compinit に後に。
## completion for gem transition of rbenv
function gem-transition {
local tmpfile=/tmp/current_gem_list
if [ $# -ne 2 ]; then
echo "usage: command version1 version2"
return
fi
rbenv install $2
rbenv global $1
rbenv rehash
for window in `tmux list-windows -F '#I'`; do
tmux select-window -t $window
tmux send-keys "source ~/.zshrc" C-m
done

Emacs でキーワード引数がうまくハイライトされていなかったのをなおす

memo

flymake-ruby が原因だった。

ruby が system のをとっていた(?)

rbenv の ruby を見るようにした。

org-mac-link-grabber.el (contrib/ にある) が、 org-mac-link.el に変わっていた。

(require 'org-mac-link-grabber)
(global-set-key (kbd "C-c ol") 'omlg-grab-link)

(require 'org-mac-link)
@Nyoho
Nyoho / gist:7884665
Created December 10, 2013 02:01
npm install したら、ここからエラーが出た。
npm http 404 https://registry.npmjs.org/http-server/-/http-server-0.6.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/http-server/-/http-server-0.6.1.tgz
npm ERR! Error: 404 Not Found
npm ERR! at WriteStream.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:57:12)
npm ERR! at WriteStream.EventEmitter.emit (events.js:117:20)
npm ERR! at fs.js:1596:14
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
@Nyoho
Nyoho / dot.zshrc-part
Last active December 30, 2015 21:09
vagrant plugin update ではまったので、vagrant plugin uninstall & install を全部やる関数を書いておいた。
function vagrant-plugin-reinstall-all {
for p in `vagrant plugin list|egrep '.+\s\(.+\)$'|awk '{print $1}'`
do
echo "Reinstall the '${p}' plugin started."
vagrant plugin uninstall $p
vagrant plugin install $p
done
}

#daitokaiet で遊びたい

daitokaiet で遊びたいので fork and clone からの bundle install をきめた。

local で、Postgres93.app を立ち上げておいて

bundle exec rake db:create:all
bundle exec rake db:migrate RAILS_ENV=development