Skip to content

Instantly share code, notes, and snippets.

carlo-rtr / DropwizardDAOTest
Created Nov 15, 2012
DAO Testing with Dropwizard hibernate
View DropwizardDAOTest
package com.rtr.infra.wizard.test;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.context.internal.ManagedSessionContext;
import org.junit.After;
import org.junit.Before;
public abstract class DropwizardDAOTest {
ragnard / redis.clj
Last active Feb 20, 2021
Using Redis for persistent memoization of Clojure functions
View redis.clj
(ns util.redis
(:refer-clojure :exclude [memoize])
(:require [taoensso.carmine :as car]))
;; boilerplate stuff that is not in Carmine
(def ^:dynamic ^:private *pool*)
(def ^:dynamic ^:private *spec*)
(defmacro with-redis
gsoltis / rx.firebase.js
Last active Mar 2, 2017
Quick Firebase / RxJS binding prototype
View rx.firebase.js
(function () {
var makeCallback = function(eventType, observer) {
if (eventType === 'value') {
return function(snap) {
} else {
return function(snap, prevName) {
// Wrap into an object, since we can only pass one argument through.
observer.onNext({snapshot: snap, prevName: prevName});
View gist:698bd36e2ddba92049fc
$ bin/jruby -X+T bin/irb
irb(main):001:0> Truffle::CExt.inline %s{
irb(main):002:0: #include <unistd.h>
irb(main):003:0: #include <stdio.h>
irb(main):004:0: }, %s{
irb(main):005:0: printf("Hello, World! I'm %d\n", getpid());
irb(main):006:0: }
Hello, World! I'm 36641
=> true
irb(main):002:0> exit
bishboria /
Last active Aug 27, 2021
Springer made a bunch of books available for free, these were the direct links