Skip to content

Instantly share code, notes, and snippets.

View kumarshantanu's full-sized avatar

Shantanu Kumar kumarshantanu

View GitHub Profile
@kumarshantanu
kumarshantanu / keybase.md
Created January 25, 2018 04:10
Keybase verification

Keybase proof

I hereby claim:

  • I am kumarshantanu on github.
  • I am kumarshantanu (https://keybase.io/kumarshantanu) on keybase.
  • I have a public key ASA0DqamW6PQjQyl_-bJHXrfpaCtJQkjYl6l02334oNRZQo

To claim this, I am signing this object:

@kumarshantanu
kumarshantanu / brew-install-rust-0.2.log
Created March 30, 2012 17:51
Output of `brew install -v rust`
==> Downloading http://dl.rust-lang.org/dist/rust-0.2.tar.gz
Already downloaded: /Users/shantanu/Library/Caches/Homebrew/rust-0.2.tar.gz
/usr/bin/tar xf /Users/shantanu/Library/Caches/Homebrew/rust-0.2.tar.gz
==> ./configure --prefix=/usr/local/Cellar/rust/0.2
./configure --prefix=/usr/local/Cellar/rust/0.2
configure: looking for configure programs
configure: found cmp
configure: found mkdir
configure: found printf
configure: found cut
@kumarshantanu
kumarshantanu / config.log
Created July 28, 2011 14:19
config.log for `brew install beanstalk` on Snow Leopard
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/beanstalk/1.4.6 --with-event=/usr/local
## --------- ##
## Platform. ##
(ns example.flash
(:use compojure.core)
(:use ring.util.response)
(:use ring.middleware.session)
(:use ring.middleware.flash)
(:require [compojure.route :as route]))
(defn show-new [flash]
(str "Flash: " flash
"<br/>
(in-txn db
(let [e (find-by-id blog-entry-meta 3)
r ((find-rels e entry-comment-meta) e)
c (first r)]
(println "** Deleting comment **")
(delete c)
(println "** Deleting entry-comment graph **")
(delete-cascade e)))
(in-db db
(let [e (find-by-id blog-entry-meta 2)
r ((find-rels e entry-comment-meta) e)
c (first r)
s (find-siblings c e)
sc (find-siblings c e :cols [:content :name :email])
sw (find-siblings c e :where ["name LIKE ?" "Phi%"])
sb (find-siblings c e :cols [:content :name :email] :where ["name LIKE ?" "Phi%"])]
(ppe "\nChild: " c)
(ppe "\nSiblings:" s)
(in-db db
(let [e (find-by-id blog-entry-meta 2)
r ((find-rels e entry-comment-meta) e)
rc ((find-rels e entry-comment-meta :cols [:content :name :email]) e)
rw ((find-rels e entry-comment-meta :where ["email=?" "hey@nospam.com"]) e)
rb ((find-rels e entry-comment-meta :cols [:content :name :email]
:where ["email=?" "hey@nospam.com"]) e)]
(ppe "\nEntry:" e)
(ppe "\nRelations:" r)
(ppe "\nRelations with selected columns:" rc)
(in-txn db
(let [e (find-by-id blog-entry-meta 1)
c (EntryComment. {}
{:content "Comment #1"
:whenposted (new java.util.Date)
:name "Whatever"
:email "no@spam.com"} )
saved (save-deps e [c])]
(ppe "Saved 1 child for entry (ID=1)" saved))
(let [e (find-by-id blog-entry-meta 2)
(in-db db
(let [ea (find-by-criteria blog-entry-meta :cols count-col)
ew (find-by-criteria blog-entry-meta :cols count-col :where ["title=?" "Hello World"])]
(println "All records:" (read-count-col ea))
(println "Records with WHERE clause:" (read-count-col ew)))
(in-db db
(let [e1 (find-by-id blog-entry-meta 1)
ea (find-by-criteria blog-entry-meta) ;; finds all records
ec (find-by-criteria blog-entry-meta :cols [:title :content])
ew (find-by-criteria blog-entry-meta :where ["title=?" "Hello World"])
eb (find-by-criteria blog-entry-meta :cols [:title :content] :where ["title LIKE ?" "Hello%"])]
(ppe "Entry 1:" e1)
(ppe "All Entries:" ea)
(ppe "Entries with selected columns:" ec)
(ppe "Entries with WHERE clause:" ew)