This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. |
This file contains 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 ubuntu:latest | |
MAINTAINER Takumi Kinjo | |
RUN apt-get update | |
RUN apt-get check | |
RUN apt-get dist-upgrade -y | |
RUN apt-get install -y apache2 | |
# See http://www.kstaken.com/blog/2013/07/06/how-to-run-apache-under-docker/ |
This file contains 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
.vagrant |
This file contains 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 perl | |
# outlinefill.pl <outline indent chars> <output delimiter> | |
@b = (); | |
while (<STDIN>) { | |
chomp; | |
@a = split /$ARGV[0]/, $_; | |
@b = () if ($#a < $#b); |
This file contains 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
# . <(curl -L http://goo.gl/pdDKD) | |
# e.g.: jked /etc/hosts:3: | |
function jked { | |
file=`echo "$@" | sed 's/[:]/ /g' | awk '{print $1}'` | |
n=`echo "$@" | sed 's/[:]/ /g' | awk '{print $2}'` | |
if echo "$n" | grep '^[0-9]*$'; then | |
vi "$file" +"$n" | |
else | |
vi "$file" |
This file contains 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
*.elc |
This file contains 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
Register users and memberships to Redmine. |
This file contains 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 | |
# tested on ubuntu12.04 server | |
# this cannot perform on lion. lion's ed command does not have 'y' command. | |
# rails new my-app | |
# cd my-app | |
# bash < <(curl -s https://raw.github.com/gist/2862788/ed729517cc94c3c3aee44bdbec1f3039184d5181/startup.sh) | |
git init |
This file contains 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
;; Usage: | |
;; | |
;; (defun snake-camel () (interactive)(kill-new(upcase-first(snake-to-camel(car kill-ring))))) | |
;; (defun camel-snake () (interactive)(kill-new(upcase(camel-to-snake(car kill-ring))))) | |
(defun snake-to-camel (s) | |
"" | |
(setq s (downcase s)) | |
(if (string-match "_" s) | |
(concat (let ((fs (substring s 0 (match-beginning 0)))) |
This file contains 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
# -*- coding: utf-8 -*- | |
# lambda で Proc オブジェクトを作る | |
def foo(v) | |
f = lambda { |a, b| | |
puts "#{a}, #{b}, #{v}" | |
} | |
end | |
# Proc.new で Proc オブジェクトを作る | |
def bar(v) |