Skip to content

Instantly share code, notes, and snippets.

@thickey
thickey / gist:3896845
Created October 16, 2012 01:53 — forked from stuarthalloway/gist:3068749
datomic-clojure-relational-algebra-2012-07-07
;; Datomic example code
;; Demonstrates using datalog with Clojure defrecords
(use '[datomic.api :only [q db] :as d])
;;; http://www.lshift.net/blog/2010/08/21/some-relational-algebra-with-datatypes-in-clojure-12
(defrecord Supplier [number name status city])
(defrecord Part [number name colour weight city])
(defrecord Shipment [supplier part quantity])
;; sample data
@thickey
thickey / gist:3827215
Created October 3, 2012 14:29 — forked from stuarthalloway/gist:2645453
Datomic queries against Clojure collections
;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")
@thickey
thickey / pom.xml
Created September 7, 2012 20:52
Trying out zi 0.5.4
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<packaging>jar</packaging>
<version>0.1.0-SNAPSHOT</version>
<name>test</name>
<description>FIXME: write description</description>
<url>http://example.com/FIXME</url>
@thickey
thickey / info.md
Created March 8, 2012 14:54
Lein not finding clojars artifacts
  • lein2 version (grabbed prior to adding plugins to profiles.clj): Leiningen 2.0.0-preview1 on Java 1.6.0_26 Java HotSpot(TM) 64-Bit Server VM
  • this same setup works on one machine and not another
  • swap [lein-swank "1.4.3"] for [lein-immutant "0.5.2"] or any other clojars artifacts and it still fails
@thickey
thickey / backbone-0.9.1.js
Created February 16, 2012 21:00
Externs for Backbone.js and Underscore.js
/*
* @fileoverview Externs for backbone-0.9.1.js
*
* built with http://www.dotnetwise.com/Code/Externs/index.html
* see also: http://blog.dotnetwise.com/2009/11/closure-compiler-externs-extractor.html
* via: http://code.google.com/p/closure-compiler/wiki/FAQ#How_do_I_write_an_externs_file?
*
* Note: when building via that page, you first need to load in underscrore.js, as that's a dependency.
* also, after running the extern for Backbone, you need to manually run it for:
@thickey
thickey / core.cljs
Last active August 29, 2015 14:17 — forked from scttnlsn/core.cljs
(ns nested-routing.core
(:require-macros [om.core :as om]
[secretary.core :refer [defroute]])
(:require [om.dom :as dom]
[om.core :as om]
[secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType])
(:import goog.History))

Keybase proof

I hereby claim:

  • I am thickey on github.
  • I am thickey (https://keybase.io/thickey) on keybase.
  • I have a public key whose fingerprint is 0F57 43A7 EEA0 7E10 A21C 2246 3036 3ED5 7F1F 6258

To claim this, I am signing this object:

@thickey
thickey / init.el
Last active August 29, 2015 14:07 — forked from martintrojer/init.el
;; Clojure
(require 'clojure-mode)
(setq auto-mode-alist (cons '("\\.cljs$" . clojure-mode) auto-mode-alist))
(setq inferior-lisp-program "lein repl")
;; clj-refactor
(require 'clj-refactor)
(add-hook 'clojure-mode-hook (lambda ()
(clj-refactor-mode 1)
(cljr-add-keybindings-with-prefix "C-c C-o")))
function Retry-Command
{
param (
[Parameter(Mandatory=$true)][string]$command,
[Parameter(Mandatory=$true)][hashtable]$args,
[Parameter(Mandatory=$false)][int]$retries = 5,
[Parameter(Mandatory=$false)][int]$secondsDelay = 2
)
# Setting ErrorAction to Stop is important. This ensures any errors that occur in the command are
@thickey
thickey / human_log.py
Last active August 29, 2015 14:06 — forked from steinim/human_log.py
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)