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
try (EmbeddedPostgreSQL db = EmbeddedPostgreSQL.start()) { | |
try (Handle h = DBI.open(db.getPostgresDatabase())) { | |
h.execute("CREATE DATABASE breakfast"); | |
h.execute("CREATE USER brianm with password 'secret'"); | |
h.execute("grant all privileges on database breakfast to brianm"); | |
} | |
try (Handle h = DBI.open(db.getDatabase("brianm", "breakfast"))) { | |
h.execute("create table food (id serial primary key, name text)"); | |
h.execute("insert into food (name) values ('pancake')"); |
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
this is a line | |
this is a second line | |
this is a third line |
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
Docker.build("base" => "brianm/buildy") do |b| | |
b.bash "touch hello.txt" | |
b.put "./bd.rb" => "/really_long_name.rb" | |
end |
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
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 12.app/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 12.app/lib/idea_rt.jar:/Applications/IntelliJ IDEA 12.app/plugins/junit/lib/junit-rt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Content |
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
local_client | |
server | |
client | |
ext |
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
function setjdk { | |
local ver=${1?Usage: setjdk <version>} | |
export JAVA_HOME=$(/usr/libexec/java_home -v $ver) | |
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':') | |
export PATH=$JAVA_HOME/bin:$PATH | |
} | |
function _setjdk_completion (){ | |
COMPREPLY=() |
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
@Test | |
public void testStartDeployedThing() throws Exception | |
{ | |
// find the deployment url | |
_Root root = http.prepareGet("http://localhost:25365/") | |
.setHeader("accept", MediaType.APPLICATION_JSON) | |
.execute(new JsonMappingAsyncHandler<_Root>(_Root.class)).get(); | |
_Action deploy = Iterables.find(root._actions, fieldEquals("rel", "deploy")); | |
// perform a deployment against it |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
int main(int argc, char *argv[]) { | |
size_t i; | |
void *mem, *prev; | |
mem = NULL; |
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
@Test | |
public void testBetterErrorMessage() throws Exception | |
{ | |
ObjectMapper mapper = new ObjectMapper(); | |
try { | |
mapper.writeValueAsString(new Thing()); | |
fail("should have raised an exception against a private class"); | |
} | |
catch (Exception e) { | |
assertThat(e.getMessage(), containsString("private")); |
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
java.lang.NullPointerException | |
at org.jruby.util.CodegenUtils.human(CodegenUtils.java:98) | |
at org.jruby.util.CodegenUtils.prettyParams(CodegenUtils.java:152) | |
at org.jruby.java.dispatch.CallableSelector.argumentError(CallableSelector.java:462) | |
at org.jruby.java.dispatch.CallableSelector.argTypesDoNotMatch(CallableSelector.java:436) | |
at org.jruby.java.invokers.RubyToJavaInvoker.findCallable(RubyToJavaInvoker.java:191) | |
at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:53) | |
at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:143) | |
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:272) | |
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:80) |