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
function tempjson() { | |
temp_file=$(mktemp) | |
while read -r LINE; do | |
echo $LINE >> "$temp_file" | |
done | |
export _temp_json=$temp_file | |
} | |
alias jcli="tempjson && ipython -i -c \"import json, os; f = open(os.environ['_temp_json']); data = json.load(f); f.close()\"" |
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
local hyper = {"cmd", "shift",} | |
function handles_focus(win) | |
local app = win:application() | |
local app_name = app:title() | |
if app_name ~= 'iTerm2' then | |
return false | |
end | |
if string.match(win:title(), "(tmux)") then |
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
#!/usr/bin/env bash | |
pane_at_edge() { | |
direction=$1 | |
case "$direction" in | |
"U") | |
coord='top' | |
op='<=' | |
;; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import pandas as pd | |
import numpy as np | |
def _run_starts_ends(bools): | |
""" | |
Returns a start and end bool array that marks the endpoints of | |
each contigious group of Trues | |
Parameters | |
---------- |
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
import pandas as pd | |
import numpy as np | |
def _run_starts_ends(bools): | |
""" | |
Returns a start and end bool array that marks the endpoints of | |
each contigious group of Trues | |
Parameters | |
---------- |
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
@pattern | |
def multi_return(x): | |
meta[match: x] | |
~ float [when: x > 1] | type(x), x, x | |
~ int [when: x > 100 and x < 150] | x, 'Between 100 and 150' | |
~ int [when: x > 10]| 'INT OVER 10' | |
~ int | type(x), x |
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
empty file created by nbx |
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
empty file created by nbx |
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
import ast | |
graph = {'A': set(['B', 'C']), | |
'B': set(['A', 'D', 'E']), | |
'C': set(['A', 'F']), | |
'D': set(['B']), | |
'E': set(['B', 'F']), | |
'F': set(['C', 'E'])} | |
def dfs(graph, start): |
NewerOlder