Skip to content

Instantly share code, notes, and snippets.

Divyansh Prakash divs1210

Block or report user

Report or block divs1210

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beders
beders / mini-promise.cljc
Last active Oct 25, 2019
Super minimal macro to simplify dealing with promise/async/await code in ClojureScript
View mini-promise.cljc
(defn create-function-call [param expr]
"Create an sexp for calling expr with a first argument provided by a promise.
If expr is a list (already in form suitable for a function call), insert the first argument at second position,
otherwise turn expr into a function call expression, unless the function is an fn, which is simply returned.
println -> (fn [param] (println param))
(* 2) -> (fn [param] (* param 2))
@ibraheem4
ibraheem4 / postgres-brew.md
Last active Nov 21, 2019 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)
View postgres-brew.md

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@danielrw7
danielrw7 / replify
Last active Jun 10, 2019
replify - Create a REPL for any command
View replify
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@marick
marick / about_those_lava_lamps.md
Last active May 20, 2019
About Those Lava Lamps
View about_those_lava_lamps.md

Around 2006-2007, it was a bit of a fashion to hook lava lamps up to the build server. Normally, the green lava lamp would be on, but if the build failed, it would turn off and the red lava lamp would turn on.

By coincidence, I've actually met, about that time, (probably) the first person to hook up a lava lamp to a build server. It was Alberto Savoia, who'd founded a testing tools company (that did some very interesting things around generative testing that have basically never been noticed). Alberto had noticed that people did not react with any urgency when the build broke. They'd check in broken code and go off to something else, only reacting to the breakage they'd caused when some other programmer pulled the change and had problems.

@sgnl
sgnl / postgres-brew.md
Last active Nov 19, 2019
Installing Postgres via Brew (OSX) (outdated see top most note)
View postgres-brew.md

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
View mergesort.clj
(defn mrg [[x & xrest :as X] [y & yrest :as Y] R]
(if (and (not-empty X) (not-empty Y))
(if (<= x y)
(mrg xrest Y (conj R x))
(mrg X yrest (conj R y)))
(concat R X Y)))
(defn mrgsrt [X]
(if (> (count X) 1)
(let [sides (split-at (/ (count X) 2) X)]
@danneu
danneu / golang-vs-clojure-async.md
Last active Sep 28, 2017
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video: http://www.youtube.com/watch?v=f6kdp27TYZs
View golang-vs-clojure-async.md
You can’t perform that action at this time.