Skip to content

Instantly share code, notes, and snippets.

@pshriwise
pshriwise / groups_to_block_mats.py
Last active March 28, 2024 03:54
A code snippet for converting DAGMC Cubit groups to blocks and material assignments
import cubit
for (name, gid) in cubit.group_names_ids():
# skip the 'picked' group and other groups
# that aren't materials
if name == 'picked' or 'mat' not in name:
continue
mat = name.split('/')[0].split(':')[1]
if not mat:
@pshriwise
pshriwise / dagmc_material_swap.ipynb
Last active October 24, 2023 05:10
How to swap materials in a DAGMC .h5m file using PyMOAB
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulromano
paulromano / openmc-conda-install.sh
Created May 18, 2019 20:19
Script for installing OpenMC using conda
#!/bin/bash
# This script installs OpenMC, its Python API, and all necessary dependencies
# into a conda environment. Because it uses compilers and CMake from the
# Anaconda repository, it's not necessary to have those installed on your
# system. However, at a minimum, you do need to have 'make' installed as well as
# a linker. To get the OpenMC git repository, you'll need git installed as
# well. On Debian derivatives, you can install all of these with:
#
# sudo apt install -y make binutils git
@pshriwise
pshriwise / audl_hockey_assists.py
Created June 20, 2017 21:24
Script for calculating hockey assists by team, game, or for the entire league based on Ulti-Analytics stats
import argparse
from datetime import datetime
import urllib2, json
from pprint import pprint
from tabulate import tabulate
def sum_dicts(a,b):
out_dict = {}
# list of unique key values
all_keys = list(set(a.keys()+b.keys()))
@pshriwise
pshriwise / update_dagmc_mat_names.py
Last active September 7, 2021 13:26
Python file designed to update DAGMC model group names from the old conventions to the new ones.
#!/usr/bin/env python
import numpy as np
import argparse
from pymoab import core, types
# some convenience functions
def get_category(mbi, category):
@gidden
gidden / latex-diff.py
Last active February 1, 2022 19:23
Generate diff PDF from one or more latex files
#!/usr/bin/env python
import argparse
import glob
import os
import shutil
import subprocess
def main():
@aaronhalford
aaronhalford / chromeos-crosh-custom-setup.md
Created November 28, 2014 19:59
Customize ChromeOS Crosh Terminal with Custom Fonts and Solarized Dark Theme

Customize Chromebook Chrosh Shell Environment

Requirement: Chromebook, Common Sense, Commandline Ablity, 1 hour of time

Dear developers with a spare Chromebook lets inject a little personalization into your Crosh shell with custom fonts, the solarized theme, and extra secure shell options.

Also, keep in mind that the terms Chrosh, Chrosh Window, and Secure Shell all refer to various versions and extentions built around the ChromeOS terminal. Settings that affect the ChromeOS terminal are global.

Custom Fonts

@vasilisvg
vasilisvg / HTML-presentation-tools.md
Created January 14, 2012 13:53
HTML presentation tools

#HTML presentation tools

There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.

##CSSS

CSS-based SlideShow System