Skip to content

Instantly share code, notes, and snippets.

@gazzar
gazzar / smith_monotile.py
Created April 9, 2023 00:18
stl of solid Smith hat monotile
"""
Generates an stl of the Smith aperiodic monotile
https://cs.uwaterloo.ca/~csk/hat/
https://www.sciencenews.org/article/mathematicians-discovered-einstein-tile
"""
import cadquery as cq
from cadquery import exporters
@gazzar
gazzar / ENV.yml
Last active February 10, 2024 02:14
modwave wavetable surface plots pdf generator
name: plots
channels:
- conda-forge
- defaults
dependencies:
- python=3.11.0
- tqdm
- numpy
- matplotlib
- colorcet
@gazzar
gazzar / environment.yml
Created December 19, 2022 04:16
Jupyter notebook for plotting 3D Compton+Rayleigh scatter intensity
name: compton
channels:
- conda-forge
- defaults
dependencies:
- xraylib
- mayavi
- jupyterlab
- matplotlib
- scipy
@gazzar
gazzar / flat_to_sharp.py
Created February 11, 2022 07:35
Converts the filenames written by MPC Beats' Auto Sampler to ones recognised by the modwave Sample Builder
'''
Converts the filenames written by MPC Beats' Auto Sampler to ones recognised by the
modwave Sample Builder. Copy this file to where the samples are and run it there
python flat_to_sharp.py
OR
python -m flat_to_sharp.main
Gary Ruben 2022-01-22
@gazzar
gazzar / logue-sdk install log.log
Created April 20, 2020 11:12
wsl logue-sdk installation log
The following is untested but should work for getting the logue-sdk working in wsl.
1. Install wsl and the Ubuntu image from Windows Store
2. Run wsl
3. I want to use vscode. I have it installed in Windows already. Run vscode from Linux commandline
$ code
## This runs VSCode and prompts to install the "remote wsl" extension in VSCode which I did
4. Install qemu
## This is necessary to be able to run ELF 32-bit LSB executables, of which the arm gcc compiler tools are an example.
@gazzar
gazzar / bdv_view.py
Created December 20, 2019 05:41
View data in a BigDataViewer hdf5 container in napari
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 11:31:51 2019
@author: grub0002
"""
import napari
import h5py
import dask
import dask.array as da
@gazzar
gazzar / turtle_kerri.py
Last active February 1, 2018 10:52
Kerri's avatar by turtle
import turtle as t
t.setworldcoordinates(0,300,300,0)
t.pensize(6)
nodelists = {
0: [(30,53),(47,79),(66,60),(108,21),(151,61),(175,73),(193,52)],
1: [(99,50)],
2: [(116,50)],
3: [(92,68),(107,82),(123,68)],
@gazzar
gazzar / mollweide_vis_win.py
Created February 21, 2016 01:06
Read an xsil field file and plot at Bloch vectors using mlab and as mollweide plot
#!/usr/bin/env python
from __future__ import with_statement
import sys
import numpy as np
from numpy import array, fromfile, dstack, exp, abs, sin, cos, angle, dot, arccos, pi
from enthought.mayavi import mlab, modules
from lxml import etree, objectify
import ConfigParser
import matplotlib.pyplot as plt
@gazzar
gazzar / Abundances_Human_wordcloud
Created November 10, 2014 23:23
Detectable elemental abundance in human by mass with rev C Maia
{
"metadata": {
"name": "",
"signature": "sha256:0a60a5b27e96dc522f5afeefd5a64d68ccbba9a8de9cbbde76fc531a18120e2f"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@gazzar
gazzar / mpl_colormaps-gpl
Created April 30, 2014 05:06
Geissbuehler & Lasser colourblind-friendly colourmaps
{
"metadata": {
"name": "",
"signature": "sha256:7c13bb28fce5c55dc995a8b5578f104452c534755021b94f1727f67984199872"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [