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
list = [1, 2, 3] | |
def (c, d, e) = list | |
println c | |
println d | |
println e |
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
(ns carmine-test.core | |
(:require [taoensso.carmine :as car]) | |
(:require [taoensso.carmine.locks :as carl])) | |
(def pool (car/make-conn-pool)) | |
(def spec-server1 (car/make-conn-spec)) | |
(defmacro wcar [& body] `(car/with-conn pool spec-server1 ~@body)) | |
(wcar |
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/perl -w | |
#usage: perl td2json.pl < jvm-thread-dump.log | |
use strict; | |
use warnings; | |
use JSON; | |
my $buf = ''; | |
my $row = 0; | |
my $thread_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
(ns adder.handler | |
(:use compojure.core) | |
(:require [compojure.handler :as handler] | |
[compojure.route :as route])) | |
(defn parse-input [s] | |
(Integer. (re-find #"[0-9]*" s))) | |
(def fibs | |
((fn rfib |
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 | |
#example: | |
# | |
#$repeat 3 echo 'hoge' | |
#hoge | |
#hoge | |
#hoge | |
N=$1 |
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
//継続的デリバリー p.265から | |
private void ConfirmEmailWasReceived() { | |
TimeStamp testStart = TimeStamp.NOW; | |
do { | |
if (EmailFound()) { | |
return; | |
} | |
Wait(SMALL_PAUSE); | |
} while(TimeStamp.NOW < testStart + DELAY_PRRIOD); | |
Fail("時間内にメールを受け取れなかった"); |
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/python | |
import boto.sns | |
import datetime | |
topic = 'arn:aws:sns:xxxx:xxx:xxx' | |
message = 'Hello World!' | |
conn = boto.connect_sns() | |
conn.publish(topic, message) |
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 fabric.api import env, task | |
from fabric.decorators import runs_once | |
env.hosts = ['host1','host2','host3'] | |
@runs_once | |
def _pull(): | |
print "pull artifacts" | |
@task |
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 | |
DEFAULTIF="eth0" | |
IPADDR=`/sbin/ifconfig $DEFAULTIF | grep "inet addr" | awk '{ print $2 }' | sed 's/addr://'` | |
NETMASK=`/sbin/ifconfig $DEFAULTIF | grep "inet addr" | awk '{ print $4 }' | sed 's/Mask://'` | |
NETADDR=`ipcalc -n "$IPADDR" "$NETMASK" | sed 's/NETWORK=//'` | |
echo "ip: $IPADDR" | |
echo "mask: $NETMASK" | |
echo "net: $NETADDR" |
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
diff --git a/config/default.rb b/config/default.rb | |
index 8a50b7e..2dfb27a 100644 | |
--- a/config/default.rb | |
+++ b/config/default.rb | |
@@ -11,6 +11,7 @@ Vagrant.configure("1") do |config| | |
config.ssh.forward_agent = false | |
config.ssh.forward_x11 = false | |
config.ssh.shell = "bash -l" | |
+ config.ssh.verbose = false | |