Skip to content

Instantly share code, notes, and snippets.

View ssgosh's full-sized avatar
🌴
On vacation

Sabyasachi Ghosh ssgosh

🌴
On vacation
View GitHub Profile
@foonicorn
foonicorn / gist:e6696fb8697668427ee0
Created July 20, 2014 07:05
Install Homebrew without sudo and wget/curl
#!/bin/bash
HOMEBREW_URL="https://github.com/Homebrew/homebrew/archive/master.zip"
HOMEBREW_DOWNLOAD=homebrew-master.zip
HOMWBREW_UNZIPED=homebrew-master
HOMEBREW_DIR="$HOME/Homebrew"
# Use Python to download homebrew because wget and curl may not be installed.
python -c "import urllib2; r=urllib2.urlopen('$HOMEBREW_URL'); f=open('$HOMEBREW_DOWNLOAD','w'); f.write(r.read()); f.close()"
@tammoippen
tammoippen / crappyhist.py
Last active May 15, 2024 15:28
Draw a crappy text-mode histogram of an array (python 3)
import numpy as np
def crappyhist(a, bins=50, width=140):
h, b = np.histogram(a, bins)
for i in range (0, bins):
print('{:12.5f} | {:{width}s} {}'.format(
b[i],
'#'*int(width*h[i]/np.amax(h)),
h[i],