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
#!/bin/sh | |
function error() { | |
echo "'$1' has trailing spaces.\n" >&2 | |
} | |
git diff --cached --name-only | (while read f; do | |
ERROR=0 | |
if grep -n '[[:space:]]$' "$f" ; then | |
error $f |
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
def simpleblock(&block) | |
block.call | |
end | |
class Sandbox # こういうときは BasicObject 継承がいいと思うけど説明の都合でこのまま | |
end | |
def sandbox(&block) | |
Sandbox.new.instance_eval(&block) | |
end |
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
#!/bin/sh | |
# Get github access_token in API v3 | |
# see http://developer.github.com/v3/#authentication | |
# | |
# requirements: | |
# * curl | |
# * sed | |
read -p "User: " user | |
read -p "Password: " password |
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 ruby | |
require "json" | |
class GcpProjectMember | |
attr_reader :users, :service_accounts | |
def initialize | |
@users = Hash.new{|h,k| h[k] = [] } | |
@service_accounts = Hash.new{|h,k| h[k] = [] } | |
end |
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
#!/bin/bash | |
LOGDIR=/usr/local/nginx/logs | |
PID=/usr/local/nginx/logs/nginx.pid | |
NOW=$(date +%Y%m%d-%H%M%S) | |
cd ${LOGDIR} | |
for i in *.log; do | |
mv ${i} ${i}.tmp.${NOW} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>jenkins-agent</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/java</string> | |
<string>-Dfile.encoding=UTF-8</string> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>jenkins-agent</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/java</string> | |
<string>-Dfile.encoding=UTF-8</string> |
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 ruby | |
require 'benchmark' | |
require 'json' | |
require 'securerandom' | |
require 'objspace' | |
require 'active_model' | |
require 'hashie' | |
require 'dry-struct' |
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
#!/bin/bash | |
. ../functions/base.subr | |
install_once nginx | |
# install_once nginx_config | |
# install_once rbenv | |
# ... |
NewerOlder