Skip to content

Instantly share code, notes, and snippets.

Avatar

James Wright jrwrigh

View GitHub Profile
@jrwrigh
jrwrigh / README.md
Created Aug 24, 2021
Pdfmerger updated for python3 usage
View README.md
@jrwrigh
jrwrigh / pdfmerger.py
Created Aug 24, 2021
Pdfmerger updated for python3 usage
View pdfmerger.py
#! /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 / Matplotlib_RCParams.py
Last active Aug 27, 2021
Common addition to notebook files to set Matplotlib config options
View Matplotlib_RCParams.py
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 / FEM_MiniProject.ipynb
Last active Oct 14, 2020
FEM MiniProject ipynb
View FEM_MiniProject.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ExtendedLumpSumCalculations.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrwrigh
jrwrigh / markdown.vim
Created Jan 20, 2020
Vim syntax file to Hugo markdown files
View markdown.vim
" 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
@jrwrigh
jrwrigh / pexpect_test1.py
Last active Aug 12, 2018
stackoverflow question support
View pexpect_test1.py
#!/usr/bin/env python3
import pexpect
shell = pexpect.spawn('/bin/bash')
shell.sendline('ssh -t node0001')
shell.interact()
@jrwrigh
jrwrigh / ConicalDiffuserGeom.py
Last active Jul 7, 2018
Script to create Conical Diffuser STEP file using pythonocc
View ConicalDiffuserGeom.py
#!/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 / conical_mesh.tcl
Last active Aug 9, 2018
Script for creating conical diffuser meshes in ICEM CFD
View conical_mesh.tcl
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