Skip to content

Instantly share code, notes, and snippets.

View jrwrigh's full-sized avatar

James Wright jrwrigh

View GitHub Profile
@jrwrigh
jrwrigh / conical_mesh.tcl
Last active August 9, 2018 23:10
Script for creating conical diffuser meshes in ICEM CFD
ic_unload_tetin
#==============Parameters
# Meta
set {mesh_option} 0
# Geometry
set {in_len} 150
set {out_len} 200
set {in_r} 20
set {dif_len} 50
@jrwrigh
jrwrigh / ConicalDiffuserGeom.py
Last active July 7, 2018 12:13
Script to create Conical Diffuser STEP file using pythonocc
#!/usr/bin/env python
import math
from pathlib import Path
import argparse
import OCC
import OCC.gp as gp
import OCC.GC as GC
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeEdge, BRepBuilderAPI_MakeWire, BRepBuilderAPI_MakeFace
from OCC.BRepPrimAPI import BRepPrimAPI_MakeRevol
from OCC.Display.SimpleGui import init_display
@jrwrigh
jrwrigh / pexpect_test1.py
Last active August 12, 2018 20:13
stackoverflow question support
#!/usr/bin/env python3
import pexpect
shell = pexpect.spawn('/bin/bash')
shell.sendline('ssh -t node0001')
shell.interact()
@jrwrigh
jrwrigh / markdown.vim
Created January 20, 2020 17:29
Vim syntax file to Hugo markdown files
" Vim syntax file
" Language: markdown with embedded yaml, toml for Hugo
" Author: James Wright (james@jameswright.xyz)
" License: MIT
" Inspired by https://github.com/pbrisbin/vim-syntax-shakespeare/blob/master/after/syntax/haskell.vim
" store and remove current syntax value
if exists('b:current_syntax')
let old_syntax = b:current_syntax
unlet b:current_syntax
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrwrigh
jrwrigh / FEM_MiniProject.ipynb
Last active October 14, 2020 16:32
FEM MiniProject ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrwrigh
jrwrigh / Matplotlib_RCParams.py
Last active August 27, 2021 14:38
Common addition to notebook files to set Matplotlib config options
plt.rcParams.update({
'font.family': 'serif',
# 'font.serif': 'cmr10',
# 'mathtext.fontset': 'cm',
'font.serif': 'stixgeneral',
'mathtext.fontset': 'stix',
'axes.unicode_minus': False,
'font.size': 11,
'figure.dpi': 150,
'lines.linewidth': 0.5,
@jrwrigh
jrwrigh / pdfmerger.py
Created August 24, 2021 15:04
Pdfmerger updated for python3 usage
#! /usr/bin/env python
# Original author Nicholas Kim, modified by Yan Pashkovsky
# New license - GPL v3
import sys
import time
from PyPDF2 import utils, PdfFileReader, PdfFileWriter
def eprint(*args, **kwargs):
"""Print to stderr
@jrwrigh
jrwrigh / README.md
Created August 24, 2021 15:05
Pdfmerger updated for python3 usage