Skip to content

Instantly share code, notes, and snippets.

View bryan-lunt's full-sized avatar

Bryan Lunt bryan-lunt

  • Department of Computer Science, UC San Diego
  • Urbana, Illinois
View GitHub Profile
@bryan-lunt
bryan-lunt / dataannotation_dashboard_greasemonkey.js
Created May 22, 2024 17:01
Prevent Lost work on DataAnnotation.tech
// ==UserScript==
// @name Disable Back Button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disables the back button for specified URLs
// @author You
// @match https://app.dataannotation.tech/workers/tasks/*
// @grant none
// ==/UserScript==
// Replace "your-target-website-url-here" with the actual URLs you want to target
import os
import math
import tempfile
import numpy as np
from CSXCAD import ContinuousStructure, AppCSXCAD_BIN
from CSXCAD.CSProperties import CSPropMetal
from openEMS import openEMS
from openEMS.physical_constants import C0
unit = 1e-3
@oberstet
oberstet / dipole4.py
Created November 28, 2023 16:46
dipole4.py
import os
import math
import tempfile
from pprint import pprint, pformat
import numpy as np
from matplotlib import pyplot
from CSXCAD import ContinuousStructure, AppCSXCAD_BIN
from CSXCAD.CSProperties import CSPropMetal
@abravalheri
abravalheri / 0_disclaimer.md
Last active May 12, 2026 00:06
How to implement Namespace packages via `MetaPathFinder`?

Please note that the implementations here are simple PoCs, and is subject to implementation errors, bugs, over simplifications etc..

@voldien
voldien / CMakeLists.txt
Last active April 29, 2025 17:23
Using CMake for creating latex build target.
PROJECT(LatexProject NONE)
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
FIND_PACKAGE(LATEX)
IF(LATEX_FOUND)
IF(LUALATEX__FOUND)
MESSAGE(STATUS "lualatex found - ${LUALATEX_COMPILER}")
ENDIF()
IF(BIBTEX_FOUND)
MESSAGE(STATUS "bibtex found - ${BIBTEX_COMPILER}")
@sbliven
sbliven / timeout_fn.sh
Last active September 21, 2020 15:50
'timeout' command, implemented within the shell so that it works with shell functions
#!/bin/zsh
# A version of the 'timeout' command that works with shell functions
#
# Usage:
# source timeout_fn.sh
# timeout_fn DURATION COMMAND [ARG]...
timeout_fn () {
local timeout=$1
shift
@iridiumcao
iridiumcao / check_git_branch_exists.sh
Created March 22, 2020 13:57
How to check if a git branch exists in the local/remote repository?
# Local:
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists
# test if the branch is in the local repository.
# return 1 if the branch exists in the local, or 0 if not.
function is_in_local() {
local branch=${1}
local existed_in_local=$(git branch --list ${branch})
if [[ -z ${existed_in_local} ]]; then
echo 0
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@basnijholt
basnijholt / slurm_ipyparallel.md
Last active June 22, 2025 20:27
Using Slurm with ipyparallel

Using ipyparallel on the cluster

One time only

Create a parallel profile

ipython profile create --parallel --profile=slurm

cd into ~/.ipython/profile_slurm/

@cschiewek
cschiewek / x11_docker_mac.md
Last active April 24, 2026 17:32
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment: