This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -rwebrick -e "server=WEBrick::HTTPServer.new(:DocumentRoot => './', :Port => 8080);['INT', 'TERM'].each {|signal| trap(signal){ server.shutdown }};server.start;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# http://sssslide.com/speakerdeck.com/a_matsuda/rails3-recipe-book-gaiden#114 | |
ARGV.each do |file| | |
File.open(file,'r+:UTF8-MAC') do |f| | |
str = f.read | |
f.rewind | |
f.truncate(0) | |
f.set_encoding('UTF-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`brew --prefix emacs`/Emacs.app/Contents/MacOS/emacs --debug-init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 256色のカラーパレットを表示する | |
# bash と zsh にて実行可能 | |
# | |
target_shell=$1 | |
if [ -z "$1" ]; then | |
target_shell=$(basename "$SHELL") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ANSI Color code (16colors) | |
# | |
# http://ascii-table.com/ansi-escape-sequences.php | |
# http://archive.linux.or.jp/JF/JFdocs/Bash-Prompt-HOWTO-5.html | |
# Escape sequence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; from http://support.markedapp.com/kb/how-to-tips-and-tricks/marked-bonus-pack-scripts-commands-and-bundles | |
(defun markdown-preview-file () | |
"run Marked on the current file and revert the buffer" | |
(interactive) | |
(shell-command | |
(format "open -a /Applications/Marked.app %s" | |
(shell-quote-argument (buffer-file-name)))) | |
) | |
(global-set-key "\C-cm" 'markdown-preview-file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dash () | |
(interactive) | |
(shell-command | |
(format "open dash://%s" | |
(or (thing-at-point 'symbol) "")))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
EMACS=emacs-24.3 | |
TARBALL=$EMACS.tar.xz | |
wget http://core.ring.gr.jp/pub/GNU/emacs/$TARBALL | |
tar xzf $TARBALL | |
cd $EMACS | |
./configure --infodir=~/.info | |
make install-info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://ejohn.org/blog/simple-javascript-inheritance/ | |
function Class() {} | |
Class.extend = function extend(props) { | |
var SuperClass = this; | |
function Class() { | |
if (typeof this.init === 'function') { | |
this.init.apply(this, arguments); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
wget https://raw.github.com/gitbits/git-ls-branches/master/git-ls-branches | |
chmod u+x git-ls-branches | |
wget https://raw.github.com/gitbits/git-info/master/git-info | |
chmod u+x git-info | |
wget https://raw.github.com/gitbits/git-info/master/git-pager | |
chmod u+x git-pager |
OlderNewer