Skip to content

Instantly share code, notes, and snippets.

@joyrexus
joyrexus / README.md
Last active April 8, 2024 09:15
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@noiges
noiges / tischkonzert.txt
Last active April 23, 2017 12:25
Attempt to write down the lyrics of the german song "Tischkonzert" by "Rakede": http://www.youtube.com/watch?v=LbLfg5m3tns
Meine Freundin ist weg (so wie Schecks aus Amerika).
Geilheit macht mich zum Teilzeit-Polemiker.
Freiheit bringt mich jetzt nicht weiter Mann,
ich frage mich: Was fang ich bloß mit so viel Freizeit an?
Ich hab Chips gekauft und fern gesehen,
VIPs beim Boxen und Kochen im Dschungel — und in den Wehen.
Ich weiß nur: Live ist als Scheiß einzustufen!
Mir wars egal — ich hab 300 mal da angerufen.
@stuarthalloway
stuarthalloway / Datomic News Updates
Created June 18, 2012 14:53
Datomic update examples against a social news database
;; Datomic example code
;; demonstrates various update scenarios, using a news database
;; that contains stories, users, and upvotes
;; grab an in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))
@stuarthalloway
stuarthalloway / gist:2645453
Created May 9, 2012 15:22
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")
@stuarthalloway
stuarthalloway / gist:2559635
Created April 30, 2012 16:11
Using data functions on both peer and transactor side
;; this code valid as of build 3084
;; in-memory example database
(use '[datomic.api :only (db q) :as d])
(def uri "datomic:mem://test")
(d/create-database uri)
(def conn (d/connect uri))
;; example schema
(d/transact conn [{:db.install/_attribute :db.part/db,
@stuarthalloway
stuarthalloway / gist:2158138
Created March 22, 2012 12:54
Many to Many Datomic example
;; Datomic example code
;; make in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://matches")
(d/create-database uri)
(def conn (d/connect uri))
;; add the match attribute
(d/transact
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.