Skip to content

Instantly share code, notes, and snippets.

View bskinn's full-sized avatar

Brian Skinn bskinn

View GitHub Profile
@bskinn
bskinn / ORCA_gbw.md
Created September 18, 2017 13:59
Script by jevandezande for printing ORCA .gbw contents

From here

#!/usr/bin/env python3

import sys
import numpy as np

file_name = sys.argv[1]
@bskinn
bskinn / TempVars.md
Last active June 23, 2023 09:43
Python context manager for scrubbing of temporary variables in Jupyter notebook cells

Rationale Spillover of temporary variables can be a significant annoyance when working with Jupyter notebooks. Aesthetically and logistically, it's bothersome to have a del var1, var2, var3 hanging around at the bottom of a notebook cell to take care of cleanup of these temp variables. It prevents a Ctrl+End from going to the end of relevant code, and if an Exception is raised in the course of code execution the del cleanup doesn't happen.

A short content manager class takes care of these various problems: when execution leaves the with suite, even due to a raised exception, the indicated variables are deleted.

@bskinn
bskinn / inst_xl_addin.md
Last active March 31, 2022 23:38
Instructions for installing an MS Excel add-in

Images shown are from Win7 and Excel 2013; click any image for a larger version.

  1. Download the .xlam file of the add-in of interest

  2. Save to %USERPROFILE%\AppData\Roaming\Microsoft\AddIns
    Usually this will translate to C:\Users\[username]\AppData\Roaming\Microsoft\AddIns

  3. Open Excel

  4. Click File > Options

@bskinn
bskinn / admin_items.md
Last active September 17, 2018 01:09
Checklist for administrative items to include on repos

VBA AddIns

  • In README.md
    • Copyright (update with any changes in a new year)
    • Identify the license, and include a link to the LICENSE.txt
    • Include 'third-party disclaimer'
    • For ones with binary distributables, indicate that the files will be attached to the GitHub release
  • Create CHANGELOG.md
    • Populate with current code status, if posting existing code for the first time
  • Create standard (sub)set of new labels
@bskinn
bskinn / git logtree alias.md
Last active June 16, 2017 16:10
"logtree" alias for git, prettyprinting a particular flavor of tree-view log

Either add directly to local or global .git/config:

alias.logtree=!sh -c 'git log --graph --all --oneline --decorate=full'

Or can use git config:

> git config [--global] alias.logtree '!sh -c '"'"'git log --graph --all --oneline --decorate=full'"'"
@bskinn
bskinn / excel-mregress-tasks.txt
Last active December 30, 2017 17:09
Old text file version of completed and pending/potential tasks for excel-mregress
-- TO DO --
xxx Strip all Optional arguments, to ensure specificity of behavior?
===THESE MAY BE REDUNDANT===
Parameterized predictor transforms, eventually to be optimized over, to find, e.g., the optimal exponent for a nonlinear dependence.
Workflow mini-language? Multi-step transforms from source (predictor transform->residual analysis->...)
Arbitrary, functional-form definitions of transforms? (<!predname!>, e.g.)
@bskinn
bskinn / env_objectsinv.md
Last active September 5, 2017 04:08
On-the-fly switching between remote/local Sphinx objects.inv sourcing via an environment variable

Description

There are various situations where it's problematic for intersphinx to always retrieve objects.inv files from their network locations. The major such situations are where network access is unavailable, or very slow. As well, the downloads do always take some time, and thus local caching can usually provide speed benefits on every make.

The below is a Python 3 implementation of an environment variable-controlled switch between remote retrieval of objects.inv files and retrieval from a local cache. As written, if the envvar ISPHX_LOCAL is set to any truthy value, Sphinx will retrieve from local cache. If ISPHX_LOCAL is absent or falsey,

@bskinn
bskinn / NCI with ORCA, MultiWFN, and VMD.md
Last active April 12, 2023 03:44
Method for generating NCI plots using ORCA, MultiWFN, and VMD

Start with basename.gbw from an ORCA computation. This method has only been tested on Windows 7, primarily because MultiWFN is challenging to execute on Linux and Mac.

  1. Convert to MOLDEN format via orca_2mkl basename -molden
  2. Rename basename.molden.input to basename.molden (this is so MultiWFN will recognize it properly)
  3. Run MultiWFN; load basename.molden
  4. Export the reduced density gradient and "sign(lambda_2)*rho" to CUBE using the following MultiWFN commands:
    a. 5 (output property in spatial region)
    b. 13 (RDG)
    c. 3 (high grid over entire system -- can enter custom grid for better isosurface resolution)
    d. 2 (export CUBE)
@bskinn
bskinn / intersphinx_mappings.txt
Last active May 3, 2024 09:39
Various intersphinx mappings
# The entries in this file are checked regularly for validity via the Github Action
# sited at github.com/bskinn/intersphinx-gist.
# Please feel free to post an issue at that repo if any of these mappings don't work for you,
# or if you're having trouble constructing a mapping for a project not listed here.
Python 3 [latest]: ('https://docs.python.org/3/', None)
Python 3 [3.x]: ('https://docs.python.org/3.9/', None)
attrs [stable]: ('https://www.attrs.org/en/stable/', None)
Django [dev]: ('https://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/')
Flask [2.2.x]: ('https://flask.palletsprojects.com/en/2.2.x/', None)