Skip to content

Instantly share code, notes, and snippets.

@wholmgren
wholmgren / use-bbdiff
Last active August 11, 2024 22:18
set git difftool to bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig
@wholmgren
wholmgren / color-coded-note.tex
Last active June 10, 2021 08:57
A latex shortcut command for easily embedding color-coded author notes
\usepackage{color}
\newcommand{\Eckel}[1]{{\bf\color{blue} JE: #1}}
\newcommand{\Holmgren}[1]{{\bf\color{red} WH: #1}}
Here's some text. It can be a pain to insert good comments into tex documents. \Eckel{I have a trick for that!}.
Here's some more text. \Holmgren{Nice!}.
@wholmgren
wholmgren / googletzlookup.py
Created August 5, 2014 23:50
get time zone from lat lon via google using python
import pytz
import requests
import numpy as np
now_timestamp = np.datetime64(datetime.datetime.utcnow()).astype(float)/1e6
lat = 32.2
lon = -111.9
payload = {'location':'{},{}'.format(lat, lon), 'timestamp':str(now_timestamp)}
@wholmgren
wholmgren / newpy-newenv
Last active August 29, 2015 14:07
new python in new virtualenv
Modified from:
http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv
Local install of new python. Adjust python version to your liking.
mkdir ~/src
wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
tar -zxvf Python-2.7.8.tar.gz
cd Python-2.7.8
@wholmgren
wholmgren / erbs.ipynb
Created May 12, 2016 18:35
erbs testing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Column Description
Pac0 AC-power output from inverter based on input power and voltage (W)
Pdc0 DC-power input to inverter, typically assumed to be equal to the PV array maximum power (W)
| to the PV array maximum power (W) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.