Skip to content

Instantly share code, notes, and snippets.

View sathyavijayan's full-sized avatar
🐢

Sathyavijayan Vittal sathyavijayan

🐢
View GitHub Profile
@sathyavijayan
sathyavijayan / script.clj
Created December 19, 2023 12:44
Babashka script to download contentful images
(ns script
(:require [babashka.pods :as pods]
[babashka.fs :as fs]
[babashka.http-client :as http]
[clojure.data.csv :as csv]
[clojure.java.io :as io]
[clojure.string :as str]
[babashka.cli :as cli]))
;; read the CSV line-by-line into a data structure

Keybase proof

I hereby claim:

  • I am sathyavijayan on github.
  • I am sathyavijayan (https://keybase.io/sathyavijayan) on keybase.
  • I have a public key ASDYKxRw3wFU-QlGhJVtAHk1ERSWNjkC71I_PEJl8lalyQo

To claim this, I am signing this object:

# step 1 - start cljdoc - website available at http://localhost:8080
docker run --rm \ 1.01h  Tue 25 May 14:42:05 2021
--publish 8000:8000 \
--volume "$HOME/.m2:/root/.m2" \
--volume /tmp/cljdoc:/app/data \
cljdoc/cljdoc
# step 2 - install jar locally.
lein install
(ns user
(:require [verbo.sokka :as sokka]
[verbo.sokka.impl.dynamodb-task :as dyn]
[verbo.sokka.utils :as u]
[clj-time.core :as t]
[clj-time.coerce :as tc]
[clojure.tools.logging :as log]
[com.brunobonacci.mulog :as mu]))
(comment
@sathyavijayan
sathyavijayan / serde.clj
Created June 13, 2019 09:32
Kafka Avro serde in clojure (Byte munging magic for my future ref)
(ns serde
(:require [jackdaw.serdes :refer [string-serde]]
[jackdaw.serdes.avro.schema-registry :as sr]
[jackdaw.serdes.fn :as jsfn])
(:import java.nio.ByteBuffer
org.apache.kafka.common.errors.SerializationException
org.apache.kafka.common.serialization.Serdes))
(def ^:const MAGIC-BYTE (byte 0x0))
@sathyavijayan
sathyavijayan / bluetooth raspberry-pi
Last active December 7, 2017 22:20 — forked from lexruee/bluetooth raspberry-pi
install bluetooth and pybluez
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
https://stackoverflow.com/questions/33110992/python-code-for-bluetooth-throws-error-after-i-had-to-reset-the-adapter
(ns mani.file
(:require [manifold.stream :as s]
[manifold.deferred :as d]
[manifold.time :as t]
[taoensso.timbre :refer [info debug]]
[clojure.java.io :as io]))
(defn sizeof
[str]
(ns mani.file
(:require [manifold.stream :as s]
[manifold.deferred :as d]
[manifold.time :as t]
[taoensso.timbre :refer [info debug]]
[clojure.java.io :as io]))
(defn sizeof
[str]
@sathyavijayan
sathyavijayan / fish_prompt.fish
Last active February 17, 2017 15:13
Extended Bobthefish fish prompt
# name: bobthefish
#
# bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome.
#
# You will need a Powerline-patched font for this to work:
#
# https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
#
# I recommend picking one of these:
#
@sathyavijayan
sathyavijayan / dhoni_stats.clj
Created January 5, 2017 16:14
Some Clojure love to dissect test stats of MSD
(ns cricket
(:require [clojure.string :as str]
[schema.core :as s]
[schema.coerce :as c]))
(def msd-raw-stats
"2008† South Africa India 1 1 0 0
2008† Australia India 2 2 0 0
2008 England India 2 1 0 1