Skip to content

Instantly share code, notes, and snippets.

View greywolve's full-sized avatar

Oliver Powell greywolve

View GitHub Profile
@razius
razius / chrome-refresh.sh
Last active November 6, 2018 13:50
Watches the folder or files passed as arguments to the script and when detects a change it automatically refreshes the current selected Chrome tab or window.
#!/bin/bash
#
# Watches the folder or files passed as arguments to the script and when it
# detects a change it automatically refreshes the current selected Chrome tab or
# window.
#
# http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/
#
# Usage:
# ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html
@pelle
pelle / accounts.clj
Created May 8, 2012 14:37
Using database functions in Datomic transactions and annotating transaction history
(use '[datomic.api :only [q db] :as d])
(def uri "datomic:mem://accounts")
;; create database
(d/create-database uri)
;; connect to database
(def conn (d/connect uri))
@stuarthalloway
stuarthalloway / gist:2560986
Created April 30, 2012 18:42
Datomic rule to find schema attributes whose name matches a prefix
;; The Datomic schema is made up of Datomic data, so you manipulate it
;; with ordinary queries and transactions -- and with ordinary code
;; in Java or Clojure.
;; query rule that finds attributes in schema whose names start with ?prefix
;; note the Java interop call to .startsWith
;; you could create a similar rule for namespace prefixes
(def rules '[[[attr-starts-with ?prefix ?attr]
[?e :db/valueType]
[?e :db/ident ?attr]