Skip to content

Instantly share code, notes, and snippets.

View verma's full-sized avatar
💭
Working from home because the virus is out to get us!

Uday Verma verma

💭
Working from home because the virus is out to get us!
View GitHub Profile
@verma
verma / Datascript101-Chapter2.clj
Created May 6, 2016 17:07
Datascript101 - Chapter 2
(ns dt.core
(:require [datascript.core :as d]))
;; schema so nice
(def schema {:maker/email {:db/unique :db.unique/identity}
:car/model {:db/unique :db.unique/identity}
:car/maker {:db/type :db.type/ref}
:car/colors {:db/cardinality :db.cardinality/many}})

Keybase proof

I hereby claim:

  • I am verma on github.
  • I am verma (https://keybase.io/verma) on keybase.
  • I have a public key ASCHCwQdOiQ8uFIv87JUC8GqdHWapqedmLRiGhpu4QWM_Ao

To claim this, I am signing this object:

@verma
verma / postwalk.clj
Last active September 6, 2019 06:10
pre-walk vs. post-walk
:profile_data
:ber
:value
11
[:value 11]
{:value 11}
[:ber 11]
:event_type
:value
foo
(ns dt.core
(:require [datascript.core :as d]))
;; schema so nice
(def schema {:car/maker {:db/type :db.type/ref}
:car/colors {:db/cardinality :db.cardinality/many}})
;; create the connection
(def conn (d/create-conn schema))
;; main.fnl
(fn love.draw []
(love.graphics.print "Hello World" 200 200))
$ fennel --compile main.fnl > .\main.lua
;; main.lua
love.draw = function()
return love.graphics.print("Hello World", 200, 200)
end
(ns ramlpg.core
(:import [org.raml.v2.api RamlModelBuilder]
[org.raml.v2.internal.impl.commons.model.type
TypeDeclaration
FileTypeDeclaration
ArrayTypeDeclaration ObjectTypeDeclaration]))
(defn parse-raml [raml-resource]
(let [api (.buildApi (RamlModelBuilder.) raml-resource)]
(println (.isVersion10 api))
Performing task 'deps' with profile(s): ''
[buddy "1.3.0"]
[buddy/buddy-auth "1.4.0" :exclusions [[org.clojure/clojure]]]
[buddy/buddy-core "1.2.0" :exclusions [[org.clojure/clojure]]]
[commons-codec "1.10"]
[org.bouncycastle/bcpkix-jdk15on "1.56"]
[org.bouncycastle/bcprov-jdk15on "1.56"]
[buddy/buddy-hashers "1.2.0" :exclusions [[org.clojure/clojure]]]
[clojurewerkz/scrypt "1.2.0"]
[com.lambdaworks/scrypt "1.4.0"]
Section "Monitor"
Identifier "Monitor0"
VendorName "Shimian"
ModelName "QHD270"
HorizSync 88.8
VertRefresh 59.5
Option "DPMS"
Modeline "2560x1440" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
DisplaySize 597 336
EndSection
// gencarol.c
// generate carol set
//
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <time.h>
;; iterate over a single collection
(for [x (range 5)]
(* x 2))
;; iterate over multiple collections
(for [x (range 5)
y (range 5)]
[x y])
;; conditional skip certain values