Skip to content

Instantly share code, notes, and snippets.

View prjemian's full-sized avatar

Pete R Jemian prjemian

View GitHub Profile
@prjemian
prjemian / Qt-Application-setup
Created May 10, 2022 18:19
Setup a QApplication for testing
from PyQt5.QtWidgets import QApplication
import sys
qapp = QApplication(sys.argv)
# custom format of the git log: git lg
# Thanks to Fanny Rodolakis (@rodolakis)!
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@prjemian
prjemian / setup_caQtDM_build_environment.sh
Created April 28, 2020 16:11
sets up the Linux Mint shell for building caQtDM
#!/bin/bash
# usage: source ./setup_caQtDM_build_environment.sh
# (empirical) required packages to build on LinuxMint 19
# ref: https://packages.debian.org/buster/allpackages
#
# error | resolution
# ---------------- | ----------------------------------
# qmake | `sudo apt-get install qt5-default`
@prjemian
prjemian / path_functions.sh
Created February 24, 2020 17:43
bash: don't add same directory to PATH more than once
# bash shell script
# don't add same directory to PATH more than once
#
# EXAMPLES:
# _bin=${HOME}/bin
# if [ -d "${_bin}" ]
# then prepend_path ${_bin}
# fi
#
@prjemian
prjemian / dropdown.md
Created May 7, 2019 18:39
markdown details dropdown expansion

how to show a dropdown for more details in markdown:

<details>
<summary>details</summary>
<p>

```
source
```
@prjemian
prjemian / ophyd motor soft limits.py
Last active April 29, 2019 21:04
shows how to extend EpicsMotor to change soft limits
from ophyd import EpicsMotor, EpicsSignal, Component
from bluesky import RunEngine
from bluesky import plans as bp
RE = RunEngine({})
class MyMotor(EpicsMotor):
high_soft_limit = Component(EpicsSignal, '.HLM', kind='omitted')
low_soft_limit = Component(EpicsSignal, '.LLM', kind='omitted')
m1 = MyMotor("vm7:m1", name="m1")
@prjemian
prjemian / assemble_synApps.sh
Created February 9, 2019 22:29
assembling synApps 6 (2019-02)
#!/bin/bash
shopt -s expand_aliases
EPICS_BASE=/usr/local/epics/base-7.0.2
SUPPORT=R6-0
CONFIGURE=R6-0
UTILS=R6-0
DOCUMENTATION=R6-0
@prjemian
prjemian / epics-env-setup.sh
Last active February 10, 2019 18:02
bash shell script to setup EPICS developer's environment
#!/bin/bash
# file: epics-env-setup.sh
# purpose: bash shell script to setup EPICS developer's environment
# usage:
# . /complete/path/to/epics-env-setup.sh
# example for ~/.bash_aliases file:
# _script=/usr/local/epics/epics-env-setup.sh
@prjemian
prjemian / run_pymca.sh
Created February 8, 2019 19:41
Run PyMCA from a custom conda environment
#!/bin/bash
# file: run_pymca.sh
#
# Runs PyMCA from a custom conda environment
# Creates and installs the environment if not present
# Installation can take about ten minutes (depends on workstation)
export CONDA_ENV_NAME=pymca_python3_qt5
export ACTIVATE=/APSshare/anaconda3/x86_64/bin/activate
@prjemian
prjemian / create_release_notes.py
Created July 11, 2017 16:40
Create release notes for a new relase of a GitHub repository
```
#!/usr/bin/env python
# Coded for both python2 and python3.
'''
Create release notes for a new relase of a GitHub repository.
Assumes that the repository has committed work (tags, pulls,
issues, commits) on a milestone.