Skip to content

Instantly share code, notes, and snippets.

# input and DC coupling
V0 1 0 Vin
Pgain 0 2 1 100000
Cdc 2 3 1e-6
R100k 3 4 100000
R1k 4 0 1000
Oamp 4 5 5 # buffer
R33k 5 6 33000
@hemmer
hemmer / halite.cpp
Created November 9, 2022 18:05 — forked from signaldust/halite.cpp
Halite - an analog circuit simulator in ~1k lines of code
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
// set to 1 to make LU factorization show pivots
#define VERBOSE_LU 0
// gMin for diodes etc..
static const double gMin = 1e-12;
@hemmer
hemmer / Makefile
Created October 28, 2022 07:39 — forked from Simon-L/Makefile
# Untar this in current dir
# https://github.com/alandefreitas/matplotplusplus/releases/download/v1.1.0/matplotplusplus-1.1.0-Linux.tar.gz
LDFLAGS = lib/libmatplot.a lib/Matplot++/libnodesoup.a -lpng -lz -ltiff -ljpeg
CXXFLAGS = -std=c++17 -I../chowdsp_wdf/include -Iinclude
SRC = main.cpp
OUT = main
$(OUT): $(SRC)
diff --git a/Makefile b/Makefile
index 74044665..9f048f58 100644
--- a/Makefile
+++ b/Makefile
@@ -106,7 +106,7 @@ cleandep:
$(MAKE) -C dep clean
run: $(STANDALONE_TARGET)
- ./$< -d
+ valgrind --track-origins=yes ./$< -d
const int numLEDS = 4;
const int LEDs[numLEDS] = {5, 6, 3, 9};
int binaryVariable = 0;
void setup() {
// put your setup code here, to run once:
for (int k = 0; k < numLEDS; k++) {
pinMode(LEDs[k], OUTPUT);
analogWrite(LEDs[k], 0);
@hemmer
hemmer / jisho_2_wanikani.js
Created September 27, 2020 16:53
Adds links to wanikani vocab pages from the button on jisho
// ==UserScript==
// @name Add proper Wanikani links to Jisho
// @version 1
// @grant none
// @include https://jisho.org*
// ==/UserScript==
var aTags = document.getElementsByTagName("a");
var searchText = "wanikani";
@hemmer
hemmer / front-template
Created June 2, 2020 07:05
automatic kana
<div id="card-front">
<div id="quest">
<div id="quest-display">
{{Characters}}
</div>
<div id="quest-name"></div>
<div class="input">
{{type:Do_Not_Modify}}
</div>
</div>
import time
import os
import numpy as np
from pathlib import Path
import tensorflow as tf
print("tensorflow version: ", tf.__version__)
@hemmer
hemmer / mesh.py
Created January 18, 2016 14:00
generating a nonuniform mesh
#!/usr/bin/env python
from scipy import optimize
from scipy import integrate
import numpy as np
import sys
l, L = 0.02, 1
N = 128
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"