This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn uuid [] (str (java.util.UUID/randomUUID))) |