- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
This file contains hidden or 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
[alias] | |
unstage = reset HEAD -- | |
changed = "!git diff-tree --no-commit-id --name-only -r $2" | |
tree = log --graph --all --oneline | |
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ / | |
locate = ! git log --follow --all --remotes -3 --pretty=format:'%h' -- $1 | xargs -I_ git show --abbrev-commit --stat _ | |
test = ! git log --follow --all --remotes -3 --pretty=format:'%h' -- "$1" | |
ss = "!f() { default=$(date '+Staged Stash: %Y-%m-%d %I:%M %p'); msg=${1-$default}; git stash push -m \"$msg\" -- $(git diff --staged --name-only); }; f" | |
diff-f = diff --name-status | |
cp = cherry-pick |
This file contains hidden or 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 | |
result="" | |
while [[ -z "$result" ]]; do | |
result=$(jupyter server list 2> /dev/null | grep http | cut -f1 -d' ') | |
sleep 1 | |
done | |
echo "$result" |
This file contains hidden or 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 | |
port=$(/usr/local/slurm/bin/reconnect_tunnels --list 2> /dev/null) | |
tmux new-session -d -s jupyter | |
tmux send-keys -t jupyter "cd /data/$USER; jupyter lab --no-browser --port=$port" C-m | |
tmux new-session -d -s main | |
sleep 5 | |
tmux send-keys -t main "cd-data; get-jupyter-url.sh" C-m |
This file contains hidden or 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
sinteractive --mem=40g --cpus-per-task=16 --tunnel --time 36:00:00 |
This file contains hidden or 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 importlib | |
from abc import ABCMeta, abstractmethod | |
from typing import Literal | |
class NoSolutionsError(Exception): | |
"""Raised if a model is infeasible.""" | |
pass | |
class SolverMeta(metaclass=ABCMeta): |
This file contains hidden or 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
# Set Tmux's default keystroke to C-a, a binding which comes from GNU Screen | |
# and is quite commong among Tmux users. | |
set-option -g prefix C-a | |
unbind C-b | |
# fix emacs C-a | |
bind a send-prefix | |
# Better colors | |
set -g default-terminal "screen-256color" |
This file contains hidden or 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
""" | |
Export a Conda environment with --from-history, but also append | |
Pip-installed dependencies | |
Exports only manually-installed dependencies, excluding build versions, but | |
including Pip-installed dependencies. | |
Lots of issues requesting this functionality in the Conda issue tracker, no | |
sign of progress (as of March 2020). |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
<!DOCTYPE html> | |
<html class="sl-root decks export loaded ua-phantomjs> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>deck: Slides</title> | |
<meta name="description" content="Slides"> |
This file contains hidden or 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 | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |