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 func_without_args | |
yield if block_given? | |
end | |
def func_with_block &block | |
yield block | |
end | |
def func_with_proc p | |
p.call |
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
Earthquake.init do | |
output do |item| | |
next unless item["_stream"] | |
if item["text"] =~ /@aibou/i | |
notify "#{item["user"]["screen_name"]}: #{item["text"]}" | |
end | |
end | |
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
sudo apt-get install git nodejs npm libgnome-keyring-dev | |
sudo npm config set python /usr/bin/python2 -g | |
# if there is /usr/bin/nodejs and is not /usr/bin/node , run this: | |
cd /usr/bin && sudo ln -s nodejs node && cd ~/ | |
git clone https://github.com/atom/atom | |
cd atom/ | |
script/build | |
sudo script/grunt install |
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
package main | |
import ( | |
"fmt" | |
) | |
func countHit(a string, b string) (hits int) { | |
for i := 0; i < 10; i++ { | |
if a[i] == b[i] { | |
hits ++ |
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
package main | |
import ( | |
"fmt" | |
"errors" | |
) | |
func hoge() (string, error) { | |
return "hello", errors.New("hello err") | |
} |
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
hello: | |
method: GET | |
patterns: | |
- request: | |
params: | |
name: "Tom" | |
response: | |
body: "Hello, Tom!" | |
- request: | |
params: |
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
# -*-Shell-script-*- | |
# | |
# functions This file contains functions to be used by most or all | |
# shell scripts in the /etc/init.d directory. | |
# | |
TEXTDOMAIN=initscripts | |
# Make sure umask is sane | |
umask 022 |
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
{ | |
"handlers": { | |
"hipchat": { | |
"type": "pipe", | |
"command": "/etc/sensu/handlers/hipchat.rb" | |
}, | |
"grafana-image": { | |
"type": "pipe", | |
"command": "/etc/sensu/handlers/grafana-image.rb" | |
} |
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
require 'spec_helper' | |
describe package('ntp') do | |
it { should be_installed.with_version('4.2.6p5-30.24.amzn1') } | |
end | |
# describe service('ntpd') do | |
# it { should be_enabled } | |
# it { should be_running } | |
# 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
resource "aws_vpc" "loadtest" { | |
cidr_block = "10.200.0.0/16" | |
enable_dns_support = true | |
enable_dns_hostnames = true | |
tags { | |
Name = "load-test" | |
} | |
} | |
resource "aws_subnet" "public-loadtest-a" { |
OlderNewer