Skip to content

Instantly share code, notes, and snippets.

Indraniel indraniel

Block or report user

Report or block indraniel

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
indraniel /
Created Dec 17, 2019 — forked from ramnathv/
Creating a clean gh-pages branch

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 /
Created Apr 22, 2019 — forked from drmalex07/
A simple example for #python #gnuplot
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 /
Created Jan 26, 2019 — forked from john2x/
Clojure Destructuring Tutorial and Cheat Sheet

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 / 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 <>
# Copied from
# Nim rewrite by Laszlo Szathmary <>
# thanks to narimiran and kickeroo for making the code more idiomatic Nim code
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'])
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
indraniel /
Last active Jan 2, 2019
Chicken Scheme scratches
$ rlwrap csi

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

#;2> (p:system "ls")
Applications			Library				bin
indraniel / GitHub
Created Dec 4, 2018 — forked from Integralist/GitHub
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article:
View GitHub
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
# Example...
indraniel /
Created Dec 3, 2018
clj tools version of `lein-try`
# tools-deps equivalent of `lein-try`
# Additionally see:
# -- what user/find-deps links to
# -- clj-based uberjarrer
View Running and Writing Output to console at the same time
p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
# Grab stdout line by line as it becomes available. This will loop until
# p terminates.
while p.poll() is None:
l = p.stdout.readline() # This blocks until it receives a newline.
print l
# When the subprocess terminates there might be unconsumed output
# that still needs to be processed.
You can’t perform that action at this time.