Skip to content

Instantly share code, notes, and snippets.

View bcperea's full-sized avatar

Brian Perea bcperea

View GitHub Profile
@bcperea
bcperea / cli-tools
Created May 22, 2019 06:07
A list of useful CLI tools.
fzf - A command-line fuzzy finder
https://github.com/junegunn/fzf
bat - A cat(1) clone with wings
https://github.com/sharkdp/bat
fd - A simple, fast and user-friendly alternative to 'find'
https://github.com/sharkdp/fd
hyperfine - A command-line benchmarking tool
@bcperea
bcperea / streaming.py
Created July 31, 2018 19:45 — forked from bdarnell/streaming.py
Demo of streaming requests with Tornado
"""Demo of streaming requests with Tornado.
This script features a client using AsyncHTTPClient's body_producer
feature to slowly produce a large request body, and two server
handlers to receive this body (one is a proxy that forwards to the
other, also using body_producer).
It also demonstrates flow control: if --client_delay is smaller than
--server_delay, the client will eventually be suspended to allow the
server to catch up. You can see this in the logs, as the "client
@bcperea
bcperea / plot_roc_curve_binary.py
Created July 9, 2017 00:36
Plot ROC curve for a binary classification problem with scikit-learn
from sklearn.metrics import roc_curve, auc
# Let's look at the ROC curve
# Start by predicting probability rather than class
# Returns predicted probabilities for each class,
# keep only probabilities for malignant (class 1)
y_score = clf.predict_proba(X_test)[:, 1]
n_classes = 2