Skip to content

Instantly share code, notes, and snippets.

View bdpdx's full-sized avatar

Brian Doyle bdpdx

  • CodeSage, LLC
  • Lake Oswego, Oregon
View GitHub Profile
@bdpdx
bdpdx / debug_helper_additions.c
Created July 22, 2023 17:06
ESP-IDF All tasks backtrace to JSON
/*
Based on this fantastic work by Chip Weinberger:
https://github.com/espressif/esp-idf/pull/11575
This function can be added to:
esp-idf/components/esp_system/port/arch/xtensa/debug_helpers.c
with declaration to:
@bdpdx
bdpdx / gist:d7efccec55ddc84c36dadf3d9cd472ed
Created January 8, 2021 03:12 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@bdpdx
bdpdx / CGVectorArithmetics.swift
Created October 10, 2020 22:07 — forked from fewlinesofcode/CGVectorArithmetics.swift
2d Vector Arithmetics Swift 5
//
//
// CGVectorArithmetics.swift
//
// Created by fewlinesofcode.com on 2/6/19.
// Copyright © 2019 fewlinesofcode.com All rights reserved.
//
import Foundation
import CoreGraphics
@bdpdx
bdpdx / Vector2D.swift
Created October 10, 2020 21:35 — forked from fewlinesofcode/Vector2D.swift
Some useful operations on 2d vectors
//
// Vector2D.swift
//
// Created by fewlinesofcode.com on 2/6/19.
// Copyright © 2019 fewlinesofcode.com All rights reserved.
//
import Foundation
struct Vector2D {
@bdpdx
bdpdx / EAGLE
Last active April 15, 2022 20:28
Routing:
to make vias, run a trace and then just switch layers.
it's useful to map f2 and f3 to top/bottom respectively so it's easy to switch on the fly
Useful commands:
show (net) // e.g. "show 5v" -> shows all elements on that net
Ground pour:
create polygon on four corners of board
width of .1524mm, 0.006"
@bdpdx
bdpdx / AppleUSBFTDILoader.swift
Last active October 29, 2019 11:00
Script to prevent loading of the Apple USB FTDI interface 0 driver on Mac OS X
#!/usr/bin/swift
/*
AppleUSBFTDILoader.swift
Brian Doyle
April 17, 2019
Released under MIT license:
@bdpdx
bdpdx / gist:f15c65923386aff092f11647f6c31511
Created January 6, 2019 00:04 — forked from morgant/gist:1753095
Building GnuTLS on Mac OS X

Preparing the Build Environment

cd ~/Desktop
mkdir wget-build
cd wget-build

Building & Installing GMP 5.0.2

# Softether VPN client setup for SSTP on Mac OS X Sierra
# install tuntap from the binaries at http://tuntaposx.sourceforge.net (can't build from source w/o kext-enabled cert from apple)
# download and build softether mac os x client, then:
sudo mv vpnclient /usr/local
sudo chown -R 0:0 /usr/local/vpnclient
sudo find /usr/local/vpnclient -type f -exec chmod 600 {} \; -type d -exec chmod 700 {} \;
sudo chmod 700 /usr/local/vpnclient/{vpnclient,vpncmd}
@bdpdx
bdpdx / NSLocking+Synchronize.swift
Created January 4, 2017 22:24
NSLocking synchronize() method that returns a value, Swift 3
extension NSLocking {
@discardableResult
func synchronize<T>(_ closure: (Void) -> T) -> T {
lock() ; defer { unlock() }
return closure()
}
}