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
sealed abstract class JValue { | |
override def toString: String = { | |
this match { | |
case JString(value) => String.format("\"%s\"", value) | |
case JBool(true) => "true" | |
case JBool(false) => "false" | |
case JNumber(value) => value.toString | |
case JNull() => "null" | |
case JList(values) => "[" ++ values.map(_.toString).mkString(", ") ++ "]" | |
case JObject(values) => "{" ++ values.foldLeft("") { case (prefix, (key, value)) => prefix ++ String.format("\"%s\": %s", key, value) } ++ "}" |
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
import org.scalatest._ | |
class RomanNumbersTest extends FlatSpec with ShouldMatchers with BeforeAndAfterEach { | |
private var numbers: RomanNumbers = _ | |
override def beforeEach() { | |
numbers = new RomanNumbers | |
} | |
"Roman numbers" should "convert I to 1" in { |
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
find src -name '*.php' -print0 | xargs -0 -I{} gsed -i 's/\(.*\)?>/\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
#!/bin/bash | |
# Put this file at: .git/hooks/post-checkout | |
# and make it executable | |
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 | |
PREV_COMMIT=$1 | |
POST_COMMIT=$2 | |
NOCOLOR="\x1B[0m" |
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
hg clone -u release https://code.google.com/p/go | |
cd go/src | |
./all.bash | |
export GOROOT=$HOME/go | |
export PATH=$GOROOT/bin:$PATH | |
cd $GOROOT/src | |
GOOS=linux GOARCH=amd64 ./make.bash --no-clean 2>&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
# defaults for jenkins continuous integration server | |
SLAVE_NAME=slave1 | |
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/$SLAVE_NAME/slave-agent.jnlp" | |
# jenkins home location | |
JENKINS_HOME=/opt/jenkins-slave | |
# location of the jenkins war file | |
JENKINS_WAR=$JENKINS_HOME/slave.jar |
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
Stream.continually(input.readLine()) | |
.takeWhile(_ != null) | |
.map(_.split(",", 2)) | |
.map { case Array(x, y) => (new java.util.Date(java.lang.Long.parseLong(x) * 1000), y) } |
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
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-2.4.0.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/hhvm-2.4.0.tar.gz | |
==> Verifying hhvm-2.4.0.tar.gz checksum | |
tar xf /Library/Caches/Homebrew/hhvm-2.4.0.tar.gz | |
==> rm -rf hphp/submodules/folly | |
==> ln -s /opt/homebrew/opt/folly hphp/submodules/folly | |
==> cmake . -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/opt/homebrew/opt/gcc48/bin/gcc-4.8 -DCMAKE_ASM_COMPILER=/opt/homebrew/opt/gcc48/bin/gcc-4.8 -DBINUTIL_LIB=/opt/homebrew/opt/gcc48/lib/x86_64/libiberty-4.8.a -DLIBIBERTY_LIB=/opt/homebrew/opt/gcc48/lib/x86_64/libiberty-4.8.a -DCMAKE_INCLUDE_PATH="/usr/local/include:/usr/include" -DCMAKE_LIBRARY_PATH="/usr/local/lib:/usr/lib" -DLIBEVENT_LIB=/opt/homebrew/opt/libeventfb/lib/libevent.dylib -DLIBEVENT_INCLUDE_DIR=/opt/homebrew/opt/libeventfb/include -DICU_INCLUDE_DIR=/opt/homebrew/opt/icu4c/include -DICU_LIBRARY=/opt/homebrew/opt/icu4c/lib/libicuuc.dylib -DICU_I18N_LIBRARY=/opt/homebrew/opt/icu4c/lib/libicui18n.dyl |
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
Vagrant up: | |
Mon 10 Feb 2014 08:47:26 AM PST | |
Shell provisioner: | |
Mon 10 Feb 2014 08:47:45 AM PST | |
Chef log: | |
[Mon, 10 Feb 2014 16:47:51 +0000] INFO: *** Chef 10.18.2 *** | |
... error |
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 install -v hhvm [±master] | |
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-2.4.0.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/hhvm-2.4.0.tar.gz | |
==> Verifying hhvm-2.4.0.tar.gz checksum | |
tar xf /Library/Caches/Homebrew/hhvm-2.4.0.tar.gz | |
==> rm -rf hphp/submodules/folly | |
==> ln -s /opt/homebrew/opt/folly hphp/submodules/folly | |
==> cmake . -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/opt/homebrew/opt/gcc48/bin/gcc-4.8 -DCMAKE_ASM_COMPILER=/opt/homebrew/opt/gcc48/bin/gcc-4.8 -DBINUTIL_LIB=/opt/homebrew/opt/gcc48/lib/x86_64/libiberty-4.8.a -DLIBIBERTY_LIB=/opt/homebrew/opt/gcc48/lib/x86_64/libiberty-4.8.a -DCMAKE_INCLUDE_PATH="/opt/homebrew/include:/usr/include" -DCMAKE_LIBRARY_PATH="/opt/homebrew/lib:/usr/lib" -DLIBEVENT_LIB=/opt/homebrew/opt/libeventfb/lib/libevent.dylib -DLIBEVENT_INCLUDE_DIR=/opt/homebrew/opt/libeventfb/include -DICU_INCLUDE_DIR=/opt/home |