Skip to content

Instantly share code, notes, and snippets.

View dexterous's full-sized avatar

Saager Mhatre dexterous

View GitHub Profile
# CLOSURES IN RUBY Paul Cantrell
# Email: username "paul", domain name ""
# I recommend executing this file, then reading it alongside its output.
# Alteratively, you can give yourself an unreasonable Ruby test by deleting all
# the comments, then trying to guess the output of the code!
# (Naive HR departments, please do not use that idea as a hiring quiz.)

Keybase proof

I hereby claim:

To claim this, I am signing this object:

dexterous / rotate.clj
Created August 31, 2022 06:21
Rotate a vector in Clojure
(defn rotate [v n]
(zero? n) v
(pos? n) (vec (concat (nthrest v n) (take n v)))
(neg? n) (rotate v (+ (count v) n))))
(defn how-not-to-factorial [x]
(condp #(< %2 %1) x
1 (throw (IllegalArgumentException.))
3 x
(loop [acc (bigint x) prev (dec x)]
(if (= prev 2) (* acc 2) (recur (* acc prev) (dec prev))))))
;; when you want to factorial...
(defn just-factorial [n] (apply * (range 1N (inc n))))
dexterous /
Last active June 4, 2021 04:41
Article text from "Is DevOps Falling into the Maturity Trap?"

@DevOpsSummit #CloudNative #Serverless #DevOps


APRIL 29, 2018 07:00 PM EDT

Guest post by Intellyx Principal Analyst Charles Araujo

I was at a conference recently when I saw it. I sighed and shook my head.

dexterous /
Created April 16, 2021 14:20 — forked from Madrox/
Art is Not About You

Art is Not About You

Forked from a community statement about Clojure

The only people entitled to say how art 'ought' to work are people who make art, and the scope of their entitlement extends only to their own art.

Just because someone creates something does not imply they owe the world a change in their status, focus and effort, e.g. from artist to community manager.

As an appreciator of a piece of art you are not thereby entitled to anything at all. You are not entitled to a say in how it evolves. You are not entitled to timely updates. You are not entitled to the attention of the artist. You are not entitled to having value attached to your complaints. You are not entitled to this explanation.

(->> (System/getProperties)
(filter #(clojure.string/ends-with? (key %) ".path"))
(map #(clojure.string/join "\n\t" (cons (key %) (clojure.string/split (val %) (re-pattern
(clojure.string/join "\n\n")
#!/bin/bash -e
if [[ -n "$DEBUG" ]]; then
set -x
PS4='+ [ $(date +%T) ] '
if [[ -f ./main.exe && ./main.exe -ot ./main.cs ]]; then
echo -n "Compiled binary outdated; removing... "
dexterous / vimium-options.json
Last active May 9, 2023 21:21
Tool Settings
"settingsVersion": "1.67.4",
"exclusionRules": [
"pattern": "https?://(mail|calendar|keep|photos|groups|drive|meet|chat|messages)*",
"passKeys": ""
"pattern": "https?://(mobile.)?*",
"passKeys": ""
dexterous /
Last active January 13, 2024 09:14
Some people just don't get how to do concurrency/parallelism right. (sigh!)
import boto3
import sys
import Queue
import threading
work_queue = Queue.Queue()
sqs = boto3.resource('sqs')
from_q_name = sys.argv[1]