Skip to content

Instantly share code, notes, and snippets.

Avatar

metacollin metacollin

View GitHub Profile
@metacollin
metacollin / ltspice.md
Last active Apr 30, 2022
LTSpice color scheme - Twilight After Dawn
View ltspice.md

screenshot

LTSpice color scheme - Twilight After Dawn

                |  R    |  G    |  B    |
Wires           |  138  |  154  |  149  |
Junctions       |  152  |  205  |  255  |
Component body  |  207  |  106  |  76   |
Graphic Flag | 218 | 239 | 163 |
@metacollin
metacollin / Polycarbonate.ini
Last active Jan 11, 2022
Slic3r settings for high quality, low-warp, high-strength printing of polycarbonate without an enclosure on a Prusa i3 MK2S
View Polycarbonate.ini
# generated by Slic3r 1.37.2-prusa3d on Thu Dec 7 09:48:20 2017
# Figured out by trial and error engineer metacollin
# Released as public domain.
# USE GLUESTICK FOR PRINT BED ADHESION
avoid_crossing_perimeters = 0
bed_shape = 0x0,250x0,250x210,0x210
bed_temperature = 110
before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\n\n
bottom_solid_layers = 8
bridge_acceleration = 1000
View cream_of_tawrtawr.rb
def cream_of_tawrtawr(final_volume, final_iso_concentration, starting_iso_concentration)
iso_volume = (final_iso_concentration * (final_volume*0.9))/starting_iso_concentration
water_volume = final_volume - iso_volume
benzaklonium_volume = final_volume*0.1
end
View make_docker_chooch.sh
#!/bin/bash
# Script to instruct the Mac how to route packets to the
# software defined network where containers created via boot2docker
# reside. This lets you casually directly to ports (ssh, http, etc. etc.)
# on those containers.
#
function ohfk(){ echo "FUCK: $*" ; }
function ohno(){ echo "FAILING: $*" ; exit 1; }
[ ! -z "$1" ] && DOCKER_MACHINE_ID="$1" || DOCKER_MACHINE_ID="default"
View wx.patch
diff -ur a/src/osx/carbon/dataobj.cpp b/src/osx/carbon/dataobj.cpp
--- a/src/osx/carbon/dataobj.cpp 2014-06-24 15:43:01.000000000 -0600
+++ b/src/osx/carbon/dataobj.cpp 2019-02-12 13:43:04.000000000 -0700
@@ -29,9 +29,9 @@
#include "wx/osx/private.h"
-#if wxOSX_USE_COCOA_OR_CARBON
- #include <QuickTime/QuickTime.h>
-#endif
View oop.cpp
#include <iostream>
class myGeneric
{
public:
myGeneric()
{
};
View wine.patch
index 3e0ebbf6ec..7a8132a221 100644
--- a/dlls/winemac.drv/keyboard.c
+++ b/dlls/winemac.drv/keyboard.c
@@ -238,14 +238,14 @@ static const struct {
{ VK_BACK, 0x0E, TRUE }, /* kVK_Delete */
{ 0, 0, FALSE }, /* 0x34 unused */
{ VK_ESCAPE, 0x01, TRUE }, /* kVK_Escape */
- { VK_RMENU, 0x38 | 0x100, TRUE }, /* kVK_RightCommand */
- { VK_LMENU, 0x38, TRUE }, /* kVK_Command */
+ { VK_RWIN, 0x5C | 0x100, TRUE }, /* kVK_RightCommand */ //was VK_RMENU, 0x38 | 0x100
View fixup_python.sh
#!/bin/bash
cd kicad.app/Contents/Frameworks
for file in *.dylib; do fixup_libs=($(otool -L $file | grep -o "@executable_path.*.dylib")); libs=($(echo ${fixup_libs[@]} | grep -o "[^/]*dylib")); for ((i=0;i<${#fixup_libs[@]};++i)); do install_name_tool -change "${fixup_libs[i]}" "@rpath/${libs[i]}" $file; done; done;
for file in *.dylib; do install_name_tool -add_rpath @loader_path/../.. -add_rpath @executable_path/../Frameworks $file; done
cd python/site-packages
fixup_libs=($(otool -L _pcbnew.so | grep -o "@loader_path.*.dylib")); libs=($(echo ${fixup_libs[@]} | grep -o "[^/]*dylib")); for ((i=0;i<${#fixup_libs[@]};++i)); do install_name_tool -change "${fixup_libs[i]}" "@loader_path/../../${libs[i]}" _pcbnew.so; done;
install_name_tool -add_rpath @loader_path/../.. -add_rpath @executable_path/../Frameworks _pcbnew.so
@metacollin
metacollin / mv_regex.sh
Last active Feb 4, 2018
A quick, dirty, and likely dangerous bash function to rename files using a find-replace style regex with capture groups referenced as such: \1 \2 \3...n
View mv_regex.sh
# source this file or copy and paste it into your ~/.bash_profile
function mv_regex()
{
regex="$1"
replace="$2"
FILE_LIST=()
NEW_NAMES=()
files="*"
View sadness.patch
diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp
index da0a10743..76ffcc9f6 100644
--- a/kicad/kicad.cpp
+++ b/kicad/kicad.cpp
@@ -173,7 +173,7 @@ void PGM_KICAD::MacOpenFile( const wxString& aFileName )
KICAD_MANAGER_FRAME* frame = (KICAD_MANAGER_FRAME*) App().GetTopWindow();
- if( !aFileName.empty && wxFileExists( aFileName ) )
+ if( !aFileName.empty() && wxFileExists( aFileName ) )