Skip to content

Instantly share code, notes, and snippets.

@fsmunoz
fsmunoz / abcl-mqtt.lisp
Created June 24, 2013 14:02
Simple example of MQTT message publish in Common Lisp and ABCL, using the Eclipse Paho client
;; Simple example of MQTT message publish using Common Lisp and ABCL
;;
;; Uses the Eclipse Paho client
;;
;; Author: Frederico Munoz <frederico.munoz@pt.ibm.com>
;; Date: 22-Jun-2013
;; Keywords: mqtt, messaging, m2m, telemetry, abcl, iot, paho, lisp
;;
;; Copying and distribution of this file, with or without modification,
;; are permitted in any medium without royalty provided the copyright
@taylorbanks
taylorbanks / gist:4196062
Created December 3, 2012 16:24 — forked from samsonjs/gist:4076746
Compiling and running mosh on Dreamhost
PREFIX=$HOME
VERSION=1.2.3-ltb
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
./configure --prefix=$PREFIX
make
make install
@jerrypnz
jerrypnz / test_watchers.clj
Created November 6, 2012 09:33
Clojure wrapper for Java 7 WatchService (java.nio.files)
(load-file "./watch_service.clj")
(refer 'watch-service)
(defn print-ev
[ev ctx]
(println "[foo]" ev " --> " ctx)
(println "Parent Dir:" (.getParent ctx)))
(defn print-ev-2
[ev ctx]
;; depends on [org.imgscalr/imgscalr-lib "4.2"]
(ns XXX.image
(:refer-clojure :exclude [read])
(:require [clojure.java.io :as io])
(:import [org.imgscalr Scalr Scalr$Method Scalr$Mode]
[java.awt Image]
[java.awt.image RenderedImage BufferedImageOp]
[javax.imageio ImageIO ImageWriter ImageWriteParam IIOImage]
@spullara
spullara / ReflectTest.java
Created December 25, 2011 22:31
Invokedynamic all in one example
package indy;
import java.lang.invoke.CallSite;
import java.lang.invoke.ConstantCallSite;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
import org.objectweb.asm.ClassWriter;
@micha
micha / gist:997056
Created May 28, 2011 17:34
Euler project problem #1
#! /usr/bin/env racket
; Euler problem #1. Sum of integers between 1 and N which are
; divisible by i, j, k, ..., or l.
;
; The sum 1+2+3+...+n = (n^2 + n)/2, call this sum-range(n).
;
; Then the sum of i+2i+3i+...+qi = i * sum-range(floor(n/i)), where
; qi is the greatest multiple of i such that i <= n.
;
@jrk
jrk / llvmlisp.cpp
Created November 5, 2009 08:26
Toy LLVM Lisp, originally from http://paste.lisp.org/display/74068
/* A Trivial LLVM LISP
* Copyright (C) 2008-2009 David Robillard <dave@drobilla.net>
*
* Parts from the Kaleidoscope tutorial <http://llvm.org/docs/tutorial/>
* by Chris Lattner and Erick Tryzelaar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.