View convert_bom.py
# This converts a BOM file in CSV format, produced by KiCad Pcbnew, | |
# by selecting File / Fabrication Outputs / BOM File | |
# into the format expected by the JLCPCB manufacture service. | |
# At least in KiCad 5.1.4 the CSV output seems a bit broken in terms of column names, | |
# which is reflected in this code. If it changes in later KiCad versions, this script | |
# needs to change, too. | |
# Use this by running the command line: python convert_bom.py inputfile.csv outputfile.csv | |
# It will overwrite your output file without asking so be careful. |
View JDplot.py
import numpy as np | |
def JDplot(data, ax, N, resolution=None, white=False, alpha=1.0, stagger=0.0, fill_color=None, fg_color=None): | |
"""Make a sliced histogram plot in the style of Joy Division's album cover. | |
- `data`, a 1D numpy array containing values. | |
- `ax`, the matplotlib Axes to draw onto. | |
- `N`, the number of histogram slices. | |
- `resolution`, the number of bins. Defaults to `N`. | |
- `white`, boolean. Sets black-on-white colour scheme instead default. |
View finnish_numbers.py
from sys import argv | |
# Function to verbal names of Finnish numbers up to 10^12 - 1. | |
# If run on the command line, takes an integer parameter and prints terms in | |
# the OEIS b-file format from zero up to the given number. | |
# Requires Python 3 (you should not be running Python 2.x in the year 2020 anyway). | |
INDIVIDUALS = { | |
0 : "", # zero is set to empty string here for convenience below |
View make_remote.fish
function make_remote | |
switch (count $argv) | |
case 0 | |
echo "Not enough arguments." | |
case 1 | |
set REPOPATH "git-repos/$argv[1].git" | |
_make_remote $REPOPATH | |
case 2 | |
set REPOPATH "git-repos/$argv[1].git" | |
_make_remote $REPOPATH |
View integrator.jl
module Integrator | |
export PlutoSim | |
const G = 1.48811382e-34 # G in units of AU and day | |
function potential{T<:Real}(mass::Vector{T}, r::Matrix{T}) | |
N = size(r,1) | |
out = zeros(N,3) | |
d = zeros(1,3) |