Skip to content

Instantly share code, notes, and snippets.

$ 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
@gsoltis
gsoltis / rx.firebase.js
Last active March 2, 2017 21:30
Quick Firebase / RxJS binding prototype
(function () {
var makeCallback = function(eventType, observer) {
if (eventType === 'value') {
return function(snap) {
observer.onNext(snap);
};
} else {
return function(snap, prevName) {
// Wrap into an object, since we can only pass one argument through.
observer.onNext({snapshot: snap, prevName: prevName});
@ragnard
ragnard / redis.clj
Last active February 20, 2021 16:27
Using Redis for persistent memoization of Clojure functions
(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
@carlo-rtr
carlo-rtr / DropwizardDAOTest
Created November 15, 2012 21:35
DAO Testing with Dropwizard hibernate
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 {
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links