Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am klauern on github.
  • I am klauern (https://keybase.io/klauern) on keybase.
  • I have a public key whose fingerprint is 8EA5 490A D98B 66F8 B37B C8D9 D9F5 EF47 681C 5A7D

To claim this, I am signing this object:

- name: Echo something
shell: echo "Hi"
@klauern
klauern / disgusting.java
Created April 27, 2012 18:09
This is awful
if (save(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
unitOfferHourlyDao.save(unitOfferHourly);
return true;
}
})) {
count++;
}
@klauern
klauern / vecs-and-maps.clj
Created February 24, 2012 03:01
Vectors and Maps in Clojure
;; So I can create a map pretty easily
user=> (def a-map { :name "Nick" :age 1000 })
#'user/a-map
;; and get a value from it with the key
user=> (get a-map :name)
"Nick"
;; I also know how to create a vector (in this case of maps)
user=> (def a-vec [ { :name "Nick" :age 1000 } { :name "Bob" :age 45 } ])
@klauern
klauern / cmdline
Created February 18, 2012 13:22
command-line output of `brew install -v redis` and `brew doctor`
airbook:local klauer$ brew install -v redis
==> Downloading http://redis.googlecode.com/files/redis-2.4.7.tar.gz
File already downloaded in /Users/klauer/Library/Caches/Homebrew
/usr/bin/tar xf /Users/klauer/Library/Caches/Homebrew/redis-2.4.7.tar.gz
==> make -C src
make -C src
MAKE hiredis
CC ae.o
CC anet.o
CC redis-benchmark.o
@klauern
klauern / inerop.clj
Created February 17, 2012 11:23
learning java interop
; So, I am new to Clojure, and I spent a bit of time reading the Java Interop page (so obviously not enough
; in retrospect), wanting to create and call some methods on instances. I have two here, and they are glorified
; wrappers around a SOAP interface. One is called MECT, which is the port that makes the call, and the other is
; called QueryHeartbeat, which is a small helper class I use to make a heartbeat call against this
; SOAP service
; some hiccups in the beginning, trying to import the classes:
=> (import [com.service.mect.MECTPortFactory :as MECT]) ; whoops
#<ClassNotFoundException java.lang.ClassNotFoundException: com.service.mect.MECTPortFactory.:as>
=> (import 'com.service.mect.MECTPortFactory) ; ok
@klauern
klauern / commandline.ps1
Created December 29, 2011 14:04
Oracle Service Name properties file for SchemasSpy
PS C:\mydocs\Downloads> java -jar .\schemaSpy_5.0.0.jar
*** Required parameter '-o' was not specified. ***
Usage:
java -jar .\schemaSpy_5.0.0.jar [options]
-t databaseType type of database - defaults to ora
use -dbhelp for a list of built-in types
-u user connect to the database with this user id
-s schema defaults to the specified user
-p password defaults to no password
@klauern
klauern / gist:1530900
Created December 29, 2011 01:10
failed 'ant clean test' on Win
PS C:\jruby> ant clean test
Buildfile: C:\jruby\build.xml
init:
prepare-bin-jruby:
clean:
[delete] Deleting directory C:\jruby\build
[delete] Deleting directory C:\jruby\docs\api
@klauern
klauern / gist:1529369
Created December 28, 2011 19:47
rvm jruby upgrade
klauer@klauer-imac ~
$ rvm upgrade jruby-1.6.5 jruby-1.6.5.1
ERROR: Destination ruby is not a known ruby string.
klauer@klauer-imac ~
$ rvm install jruby
jruby-1.6.5.1 - #fetching
jruby-1.6.5.1 - #downloading jruby-bin-1.6.5.1, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
@klauern
klauern / console
Created December 15, 2011 13:50
git clone failures in Windows
PS C:\> git clone https://github.com/jruby/jruby.git jruby-d
Cloning into jruby-d...
remote: Counting objects: 176863, done.
remote: Compressing objects: 100% (42078/42078), done.
remote: Total 176863 (delta 124156), reused 175381 (delta 122846)Receiving objects: 100% (176863/176863), 78.24 MiB | 1.02 MiB/s
Receiving objects: 100% (176863/176863), 78.63 MiB | 1.02 MiB/s, done.
Resolving deltas: 100% (124156/124156), done.
error: unable to create file test/externals/ruby1.9/excludes/Psych::TestCoder.rb (Invalid argument)
error: unable to create file test/externals/ruby1.9/excludes/Psych::TestDateTime.rb (Invalid argument)
error: unable to create file test/externals/ruby1.9/excludes/Psych::TestEmitter.rb (Invalid argument)