Hey | There |
---|---|
NewLine | Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://gist.github.com/westurner/3196564 | |
brew install readline | |
brew install zeromq | |
virtualenv ~/py | |
~/py/bin/pip install ipython pyzmq tornado pygments numpy python-dateutil pytz scipy matplotlib statsmodels pandas | |
~/py/bin/easy_install pyzmq | |
~/py/bin/easy_install tornado | |
# Remove the version check | |
vi py/lib/python2.7/site-packages/IPython/utils/zmqrelated.py | |
~/py/bin/ipython notebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:d2f389e058e5bdca375e594db6578970fa9ed3b67ca98e85e2b9865dd974ef37" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/philz/dfca51807d9431b662aa | |
export PAGER= | |
if [[ $# -ne 1 ]]; then | |
echo "$0 finds all branches and tags a commit is in, based on" | |
echo "'git log --grep' and 'git branch --contains'" | |
echo "Usage: $0 <grep_term>" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>foo</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Leak file descriptors | |
$ python <<EOF | |
import time | |
a=[] | |
while True: | |
a.append(open("/tmp/z" + str(len(a)), "w")) | |
time.sleep(0.5) | |
EOF | |
## Find leakers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
google.charts.load("current", {packages:["timeline", "corechart"]}); | |
google.charts.setOnLoadCallback(drawChart); | |
function ts_to_hms(secs) { | |
var s = secs % 60; | |
var m = Math.floor(secs / 60) % 60; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Given a log file of JSON objects with timestamps, adds a new field called | |
# "relativeTimeMs" for the duration between successive log lines, and then | |
# sorts by that field to pull out the "longest" log lines. | |
echo '{"time":"2019-08-08T17:08:08.343Z","msg":"foo"} | |
{"time":"2019-08-08T17:08:08.347Z","msg":"bar"} | |
{"time":"2019-08-08T17:08:08.349Z","msg":"baz"} | |
{"time":"2019-08-08T17:08:09.322Z","msg":"booooom"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x -euo pipefail | |
git show HEAD^:$1 > $1 | |
git add $1 | |
git commit --fixup HEAD | |
git revert --no-edit HEAD | |
git commit --amend -m"$1" | |
EDITOR=/usr/bin/true git rebase -i --autosquash HEAD^^^ |