Skip to content

Instantly share code, notes, and snippets.

Vedang Manerikar vedang

Block or report user

Report or block vedang

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
vedang / game_of_life.clj
Created Nov 16, 2019
Conway's game of life
View game_of_life.clj
(ns game-of-life
(:require [clojure.set :as cs]))
(defn calculate-neighbour-coordinates*
[[x y]]
(->> (vector [(+ x 1) y]
[(- x 1) y]
[x (+ y 1)]
[x (- y 1)]
[(+ x 1) (+ y 1)]
vedang /
Last active Nov 8, 2019
A small shell script to fetch code from git upstreams in all directories
#! /bin/bash
# find . -maxdepth 1 -type d \( ! -name . \) -print0 | xargs -0 -L1 /path/to/
echo "Working in $1"
cd "$1" || exit
vedang / psk.clj
Last active Feb 1, 2019
A Clojure simulation of the Passport Seva Kendra
View psk.clj
(ns challenges.psk
"A Simulation of the Passport Seva Kendra"
(:require [clj-time.core :as ct]
[ :as ctl])
(:import [java.util.concurrent LinkedBlockingQueue PriorityBlockingQueue]))
(def working-hours? (atom false)) ; use this to control agents.
; Turning this off will
; shutdown agents.
vedang /
Last active Aug 29, 2015
Keybase Verification

Keybase proof

I hereby claim:

  • I am vedang on github.
  • I am vedang ( on keybase.
  • I have a public key whose fingerprint is 64C0 579D EA73 EADC B9FE DD2D 02C8 3321 60B8 648C

To claim this, I am signing this object:

vedang / uniquify-recentf.el
Created Jan 27, 2014
Implements functionality similar to `uniquify' to make `recentf' results bearable.
View uniquify-recentf.el
(require 'recentf)
;; Implement functionality similar to uniquify to make recentf results bearable
;; Requires s.el and dash.el - awesome libraries from Magnar Sveen
;; Hat-tip : Baishampayan Ghose for the clojure implementation at
(require 's)
(require 'dash)
vedang / redis.clj
Created Oct 8, 2013
A gist to demonstrate how the redis API can be wrapped in Hystrix.
View redis.clj
(ns example.hystrix.redis
(:require [ :as hystrix]
[taoensso.carmine :as car :refer [wcar]])
(:refer-clojure :exclude [time get set key keys type sync sort eval]))
(def server-spec {:spec {:host ""
:port 6379}
:pool {:max-active 8}})
View routes.clj
(ns cello-world.routes
(:require [compojure.route :as route]
[compojure.core :as cc]
[ring.util.response :as rur])
(:use [ring.adapter.jetty :only [run-jetty]]))
(cc/defroutes hello-routes
(cc/GET "/hello/name/" []
(fn [req]
vedang /
Created Aug 7, 2011
a simple speed test for python switching
from timeit import Timer
from random import randint
def switch_if():
value = randint(1, 10)
if value == 1:
return '1'
elif value == 2:
return '2'
vedang /
Created Aug 7, 2011
Shell script to start a new instance of emacs or switch to an already running one.
# get id of emacs
win=$(xdotool search --onlyvisible --class emacs | head -1)
if [ "x$win" = x ]; then
# Emacs is not running
# switch to viewport 1, which is my coding viewport
~/incoming-src/dotfiles/scripts/ vpswitch switch_to_1_key
gxmessage -center -timeout 2 -nofocus -buttons "" -borderless "loading emacs..."&
# start Emacs
vedang / pascal.clj
Created Jul 10, 2011
printing Pascal's Triangle.
View pascal.clj
(defn pascal-val
"function to calculate value of element at a particular row and column
for the pascal triangle."
[r c]
(= c 0) 1
(= c r) 1
:else (+ (pascal-val (- r 1) (- c 1))
(pascal-val (- r 1) c)) ))
You can’t perform that action at this time.