Skip to content

Instantly share code, notes, and snippets.

View yo.clj
(ns adoc.core
(:require [clojure.string :as str]))
(defn parse-name [room]
(let [parsed (str/split room #"-")
name (drop-last parsed)
sector-checksum (str/split (last parsed) #"\[")
sector (first sector-checksum)
checksum (str/replace (last sector-checksum) "]" "")]
{:room-name name
View gist:32cb2338cce702aec87131be3f399fb1
RUST_BACKTRACE=1 ./target/debug/datamorpher < uspop.csv
thread 'main' panicked at 'a CSV record: StringRecord(["Davidsons Landing", "AK", "", "65.2419444", "-165.2716667"])', src/libcore/
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/
at src/libstd/
View gist:6a25fb0775ff0ebfcc554238024200b9
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ rustup default nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: default toolchain set to 'nightly-x86_64-apple-darwin'
nightly-x86_64-apple-darwin unchanged - rustc 1.33.0-nightly (7bac68a5d 2019-01-21)
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ cargo +nightly build
error: no such subcommand: `+nightly`
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ cargo run
warning: Rocket was unable to check rustc compatibility.


Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne


Keybase proof

I hereby claim:

  • I am vijaykiran on github.
  • I am vijaykiran ( on keybase.
  • I have a public key ASChck_zcupSrs77kvXgz6Sit6s_93LtQs1e6BzIuXS_iwo

To claim this, I am signing this object:

vijaykiran /
Created Jul 28, 2016 — forked from borkdude/
Fast REPL session with a cljs library using Planck

Get a fast starting REPL session with a ClojureScript library using Planck.

First, decide what dependencies Planck needs to load. This is easily done with boot like this:

$ boot --dependencies org.clojars.micha/boot-cp        ; load with-cp task that helps exporting minimal classpath to file
   --dependencies com.andrewmcveigh/cljs-time:"0.4.0"  ; load dependency you actually want to try
   with-cp -w --file .classpath                        ; write classpath to a file `.classpath`

The list of dependencies is now written to .classpath. You can re-use this file if you're dependency hasn't changed.

View gist:65922c19c120f28822ba
Debugger entered--Lisp error: (wrong-type-argument stringp ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" ""))
compare-strings("Helm" nil nil ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" "") 0 4 nil)
string-prefix-p("Helm" ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" ""))
(or (string-prefix-p " " (buffer-name b)) (string-prefix-p "Helm" (buffer-local-value 'mode-name b)))
(lambda (b) (or (string-prefix-p " " (buffer-name b)) (string-prefix-p "Helm" (buffer-local-value 'mode-name b))))(#<buffer *Org Agenda*>)
byte-code("\305!\306\211\f\211A\242\211\203A\307\n!\203\n !\2026\n\211A\242\211\203 !\203\310\311\312\"\210\202\203\310\311\312\"\210\202+\306\207" [buff-or-name f filter buf filters get-buffer nil functionp throw --cl-block-pbfop-- t] 3)
vijaykiran /
Created Feb 5, 2016 — forked from jasonrudolph/
Programming Achievements: How to Level Up as a Developer
View dojo1.hs
divides m n = n `rem` m == 0
divisors :: Int -> [Int]
divisors n = [k | k <- [1..n], k `divides` n]
sigma = sum . divisors
output :: Int -> String
output n
| sigma n > 2 * n = show n ++ " abundant "++ show (sigma n - 2 * n)
View futs.scala
import scala.concurrent._
import scala.concurrent.duration._
object Futs {
def stuff() = {
val fut1 = Future {
println("future 1")
You can’t perform that action at this time.