Skip to content

Instantly share code, notes, and snippets.

@indraniel
indraniel / style_guide.md
Created Sep 10, 2021 — forked from scottfrazer/style_guide.md
WDL Best Practices / Style Guide
View style_guide.md

"My First WDL" Template

task name {
  String in
  command {
    echo '${in}'
  }
  output {
    String out = read_string(stdout())
View jupyter_notebooks_collections.md

This page is a curated collection of Jupyter/IPython notebooks that are notable for some reason. Feel free to add new content here, but please try to only include links to notebooks that include interesting visual or technical content; this should not simply be a dump of a Google search on every ipynb file out there.

Important contribution instructions: If you add new content, please ensure that for any notebook you link to, the link is to the rendered version using nbviewer, rather than the raw file. Simply paste the notebook URL in the nbviewer box and copy the resulting URL of the rendered version. This will make it much easier for visitors to be able to immediately access the new content.

Note that Matt Davis has conveniently written a set of bookmarklets and extensions to make it a one-click affair to load a Notebook URL into your browser of choice, directly opening into nbviewer.

@indraniel
indraniel / Makefile
Last active May 19, 2020
A template to start a common-lisp project inside a separate "virtual environment"
View Makefile
.PHONY: init-project repl deps
#https://stackoverflow.com/a/23324703 (gets the absolute directory of the Makefile)
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
QUICKLISP_DIR := $(ROOT_DIR)/quicklisp
UTILS_DIR := $(QUICKLISP_DIR)/utils
SBCL := $(HOME)/sw/cl/sbcl/2.0.3/bin/sbcl
SWANK_HOST := "127.0.0.1"
@indraniel
indraniel / 1-make-patches.sh
Created May 1, 2020
technique to transfer commits from one git repository to another different git repository
View 1-make-patches.sh
#!/bin/bash
# select the relevant commits i would like to take from source git repoA
mkdir -p patches
git format-patch -1 --stdout 8adb447ccbfd88bf57a571105f6af3b000f343c5 >patches/1.patch
git format-patch -1 --stdout 8f71637c2e407aa8d9e040b1f8168cd5bc9590a4 >patches/2.patch
git format-patch -1 --stdout 968ac4b5e74abf26cf3e53c6f2a1722e8ab62de3 >patches/3.patch
git format-patch -1 --stdout d7c13e31b502049c436d898b037729d08b6078a0 >patches/4.patch
git format-patch -1 --stdout e00ddb86adebb2d528a08abd91bfd7237d32a07e >patches/5.patch
@indraniel
indraniel / gh-pages.md
Created Dec 17, 2019 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch
View gh-pages.md

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@indraniel
indraniel / gnuplot-py-example.py
Created Apr 22, 2019 — forked from drmalex07/gnuplot-py-example.py
A simple example for Gnuplot.py. #python #gnuplot
View gnuplot-py-example.py
import numpy
import Gnuplot
def rainfall_intensity_t10(t):
return 11.23 * (t**(-0.713))
def rainfall_intensity_t50(t):
return 18.06 * (t**(-0.713))
g = Gnuplot.Gnuplot()
@indraniel
indraniel / 00_destructuring.md
Created Jan 26, 2019 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet
View 00_destructuring.md

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@indraniel
indraniel / colors.nim
Created Jan 25, 2019 — forked from jabbalaci/colors.nim
A small program to make using 256 colors in Nim less painful.
View colors.nim
import strformat
import tables
# A small program to make using 256 colors in Nim less painful.
# Original ZSH version from:
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
# Nim rewrite by Laszlo Szathmary <jabba.laci@gmail.com>
# thanks to narimiran and kickeroo for making the code more idiomatic Nim code
@indraniel
indraniel / gist:9d3955f87c6b564492e688fb9c32090b
Created Jan 1, 2019 — forked from drorata/gist:b05bfd59c45eec0470f6
Nice output of pandas.DataFrame in org-mode
View gist:9d3955f87c6b564492e688fb9c32090b
import pandas as pd
import numpy as np
from tabulate import tabulate

df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C'])
print("foo")
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
@indraniel
indraniel / chicken-repl.md
Last active Jan 2, 2019
Chicken Scheme scratches
View chicken-repl.md
$ rlwrap csi

#;1> (import (prefix (chicken process) p:))
; loading /usr/local/Cellar/chicken/5.0.0/lib/chicken/9/chicken.process.import.so ...

#;2> (p:system "ls")
Applications			Library				bin
0