Skip to content

Instantly share code, notes, and snippets.

View firesofmay's full-sized avatar

Mayank Jain firesofmay

View GitHub Profile
@teklordz
teklordz / coindesk.sh
Last active July 7, 2020 16:22
Bitcoin prices in real time from the coindesk website api (bash script)
#!/bin/bash
# Credit to David Walsh for the original script <https://davidwalsh.name/bitcoin>
# The improved version of David's script doesn't go back to prompt. It keeps refreshing the prices every 5 seconds.
# Prices are in USD, EUR & GBP (in real time)
# curl must be installed in terminal
clear
echo "Coindesk BTC: "
echo " USD EUR GBP "
while [ 1 ]
(ns experimental-clojure.congeal-consecutives)
(def v [1 3 4 5 7 9 10 11 12])
(defn congeal-consecutives [coll]
(->> coll
(map-indexed (fn [i x] [(- x i) x]))
(partition-by first)
(mapv (fn [pairs]
(mapv second pairs)))))
@gorsuch
gorsuch / gist:1418850
Created December 1, 2011 18:37
clojure uuid
(defn uuid [] (str (java.util.UUID/randomUUID)))