Skip to content

Instantly share code, notes, and snippets.

😩
EWOULDBLOCK

Mridul Singhai singhai0

  • San Francisco, CA
Block or report user

Report or block singhai0

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
@singhai0
singhai0 / stashbox.sh
Created Mar 27, 2019
See list of git stashed changes
View stashbox.sh
function stashbox() {
local branch_name=$(git stash list | fzf --ansi -m --preview "echo {} | cut -d':' -f1 | xargs -I % sh -c 'git stash show --color=always % | less -R'")
if [[ $branch_name ]]; then
echo $branch_name | cut -d':' -f1| xargs git stash pop
fi
}
Courtesy: https://github.com/Brantron
@singhai0
singhai0 / matplotlib-basemap-python3x-quakes.md
Created Aug 22, 2018 — forked from dannguyen/matplotlib-basemap-python3x-quakes.md
How to use matplotlib's basemap and Python 3.x to plot earthquake data on a world map
View matplotlib-basemap-python3x-quakes.md

Mapping earthquakes in Python 3.x using matplotlib and matplotlib's basemap

(with a big assist from Anaconda)

I currently use Python for nearly all of my data science and wrangling work these days but usually find myself switching to R to visualize data using ggplot2. This is due in part to ggplot2's general excellence, but also because I had a lot of trouble learning Python's most popular viz library, matplotlib on my own...its homepage is decent enough...but its variety of plotting APIs (--pylab? OOP? %matplotlib???) has led to widely differing examples and best practices among the many online matplotlib guides (not dissimilar to the general problem of trying to practice either Python 2.x or 3.x).

That changed yesterday when I stumbled across [Nicolas P. Rougier's beautifully designed and com

@singhai0
singhai0 / addtogoodreads.js
Last active Dec 11, 2017
Bookmarklet to open Goodreads listing for an Amazon book (in the same tab/window).
View addtogoodreads.js
javascript:%20var%20array%20=%20document.URL.match(/amazon%5C.(.*?)%5C/.*?%5C/.*?%5C/(.%7B10%7D)/);%20if%20(array%20==%20null)%20%7B%20alert('Sorry,%20this%20doesn%5C't%20appear%20to%20be%20an%20Amazon%20book%20page.');%20%7D%20else%20%7B%20var%20x%20=%20window.location.replace('https://www.goodreads.com/review/isbn/'+%20array%5B2%5D%20+%20'?tld='%20+%20array%5B1%5D%20+%20'&from=bm',%20'add_review');%20x.focus();%20%7D
You can’t perform that action at this time.