Skip to content

Instantly share code, notes, and snippets.

View jarvist's full-sized avatar

Jarvist Moore Frost jarvist

View GitHub Profile
@jarvist
jarvist / delta_SCF_extract_values.sh
Created March 23, 2016 13:17
Shell scripts to generate Delta-SCF calculations with Gaussian & extract results; see http://jarvist.github.io/post/2016-03-17-delta-scf/
#!/bin/sh
# delta_SCF_extract_values.sh - extract values from Delta-SCF Gaussian calculations
for i in *neutral.log
do
# Kohn-Sham HOMO/LUMO from the 'neutral' Gaussian calculation
HOMO=` grep "occ" "${i}" | tail -n 1 | awk '{print $NF*27.2114}' `
LUMO=` grep "virt" "${i}" | head -n 1 | awk '{print $5*27.2114}' `
KSGAP=` echo "${LUMO} - ${HOMO}" | bc -l `
@jarvist
jarvist / C2H4_C2F4_dist04.00.nw
Last active July 24, 2021 16:09
NWCHEM input file for CDFT on a Ethylene (C2H4) / C2F4 molecular pair for calculating charge transfer state energies + comparing to a TD-DFT method.
title "C2F4 C2H4 with displacement: 04.00 Angstroms"
echo "This is a story about an ordinary teddy bear."
#Hellow 64GB / 16 node machine... will you be my friend?
memory stack 750 mb heap 1500 mb global 1500 mb
echo "Thundercats HO!"
geometry molA units angstroms noautoz noautosym
@jarvist
jarvist / lfgss.py
Created March 18, 2011 10:28
Beautiful Soup / Python code to monitor LFGSS message board and spawn a chrome tab on new adverts
from BeautifulSoup import BeautifulSoup
import urllib2
import re
import time
import sys
import os
user_agent = 'Mozilla/5 (Solaris 10) Gecko'
headers = { 'User-Agent' : user_agent }
@jarvist
jarvist / advancedmaterials.bst
Created March 31, 2014 14:06
Advanced Materials BibTex file... (from 2010)
%%
%% This is file `advancedmaterials.bst',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% merlin.mbs (with options: `seq-no,nm-init,ed-au,dt-jnl,xmth,dtbf,jtit-x,thtit-x,vol-it,vnum-cm,volp-blk,jpg-1,num-xser,jnm-x,bkpg-x,isbn,issn,ppx,xedn,xand,etal-xc,url,url-blk,nfss,')
%% ----------------------------------------
%% *** Advanced Materials - Jarvist Moore Frost May 2010 ***
%%
@jarvist
jarvist / angles_by_structure.py
Last active September 9, 2018 00:56
Calculates vertices of C60 buckyball from the Cartesian coordinates suggested on Wikipedia page, and a bit of permutation magic on the 'generator' thus describe. I'm sure there's a more elegant way to do the +- permutation too.
#See http://en.wikipedia.org/wiki/Truncated_icosahedron
phi = (1+5**0.5)/2 #golden mean
generator= [ [0,1,+3*phi],
[2,1+2*phi,phi],
[1,2+phi,2*phi]]
#From http://blog.adambachman.org/2008/10/simple-permutations-in-python-and-ruby.html
[Fri06Jul-12:34]jarvist@nmscde005688:~/.local/lib/python3.5/site-packages/sumo/
> python3 -m unittest discover tests
............/home/jarvist/.local/lib/python3.5/site-packages/monty/dev.py:214: UserWarning: Cannot install excepthook, IPyhon.core.ultratb not available
"Cannot install excepthook, IPyhon.core.ultratb not available")
.................................................EEEEEEEEE.E...EEFF.Froot
+--sub1
+--sub2
| +--sub2sub1
+--sub3
+--sub3sub1
# poster_split.sh
# Script to split (Google Docs 'Drawing') poster into 4 panels for printing @ A3
# mutool is part of mupdf-tools on debian
# Lovely fast built in poster command!
mutool poster -x2 -y2 "${1}" 2x2.pdf
# For tweeter.
# -background white -alpha remove - puts in white background, removes ugly black transparent regions
# -density 144 -resize 50% - super-sample @ 200% to add anti-aliasing (avoid jagged text)
@jarvist
jarvist / com.vim
Last active June 7, 2018 09:51
Vim syntax highlighting file for the NWCHEM electronic structure package input deck (.nw extension), and an even cruder one for Gaussian (.com). Put this in ~/.vim/syntax, and add a suitable loader to ~/.vim/filetype.vim . Used with the Zenburn colour sch
" Vim syntax file
" Language: Gaussian (Electronic Structure Package) Input Files
" Maintainer: Jarvist Moore Frost
" Latest Revision: 27 May 2012
if exists("b:current_syntax")
finish
endif
"Oh Fortran, always ignoring case...
@jarvist
jarvist / twitter_archive.py
Created August 29, 2011 17:15
Python script with Beautiful soup to rip Tweets from twitter account, prints as HTML for inclusion in webpage with Date/Time stamp
#!/usr/bin/python
#Original from here: http://code.activestate.com/recipes/576594/
#rips Tweets from twitter account, prints as HTML for inclusion in webpage with Date/Time stamp
import time
from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup
# Replace USERNAME with your twitter username
url = u'http://twitter.com/USERNAME?page=%s'

Keybase proof

I hereby claim:

  • I am jarvist on github.
  • I am jarvist (https://keybase.io/jarvist) on keybase.
  • I have a public key ASCjCstG9VXZQyQ-ZAyC71SKt-LDRCdDB7rDQ1ojV2y2SAo

To claim this, I am signing this object: