Skip to content

Instantly share code, notes, and snippets.

View brennanMKE's full-sized avatar

Brennan Stehling brennanMKE

View GitHub Profile
@brennanMKE
brennanMKE / errorsAndWarnings.sh
Last active May 2, 2024 17:59
Build Script to show errors and warnings marked as comments in code
TAGS="TODO:|FIXME:"
ERRORTAG="ERROR:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "^\s*//.*($TAGS).*\$|^\s*//.*($ERRORTAG).*\$" | \
perl -p -e "s/\s*\/\/\s*//g" | \
perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/"
@brennanMKE
brennanMKE / README.md
Last active April 20, 2024 23:07
Killing Arduino

Killing Arduino

The Arduino IDE has had a bug which causes the entire screen to go blank and become unusable. The following issues are related to this problem. It does not appear to be closed, but the upstream bug may have been fixed indirectly.

  • [arduino-ide#2297]
  • [arduino-ide#2148]

But if this bug is not fix, you may need to recover from the blank screen. It appears it requires killing all Arduino processes since there are some background processes which support the app. You can start by getting the process id from Activity Monitor. Filter to "Arduino" and press cmd-i to get the info. Take id and run this command with it. It is in parenthese with Process Group.

@brennanMKE
brennanMKE / IDETemplateMacros.plist
Last active April 18, 2024 17:06
Xcode File Header Templates
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___.
// All Rights Reserved.
</string>
<key>ORGANIZATIONNAME</key>
@brennanMKE
brennanMKE / README.md
Last active April 5, 2024 20:51
Jitsi Meet with a headless Raspberry Pi

Jitsi Meet with a headless Raspberry Pi

To set up a headless Raspberry Pi to connect to a Jitsi Meet server using SIP and WebRTC, you'll need the following:

  1. SIP Gateway: Set up a SIP gateway for your Jitsi Meet server. Jitsi provides a component called Jigasi for this purpose. Jigasi acts as a gateway between SIP and the Jitsi Videobridge.

  2. SIP Client: Install a command-line SIP client on the Raspberry Pi. Examples include Linphone or PJSUA from the PJSIP project.

@brennanMKE
brennanMKE / README.md
Last active April 3, 2024 21:49
Create SSH Key on Mac for Xcode

Create SSH Key on Mac for Xcode

The docs for GitHub show a command to create a key with the ed25519 encryption method which is not allowed by Xcode. Even if you are not using the Source Control features in Xcode you will often need to use an account with GitHub when you are consuming Swift packages which are pulled from GitHub.

For SSH keys there are 4 algorithms.

  • 🚨 DSA: This is an older algorithm which is no longer supported and is superceded with more modern algorithms.
  • ⚠️ RSA: This algorithm was an improvement but it is now outdated and a more modern method should be used.
  • 👀 ECDSA: Another improvement which is dependent on your computer's ability to generate random numbers.
  • ✅ Ed25519: The most recommended public-key algorithm today which you should use with GitHub.
@brennanMKE
brennanMKE / hero.ts
Last active April 1, 2024 16:16
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@brennanMKE
brennanMKE / README.md
Created March 27, 2024 18:04
Inventors

Electronics Inventors

  • Hedy Lamarr - Known for her career in Hollywood, Lamarr was also a talented inventor. She co-invented an early version of frequency-hopping spread spectrum communication, a technology that laid the foundation for modern Wi-Fi and Bluetooth.
  • Ada Lovelace - Often regarded as the first computer programmer, she worked on Charles Babbage's early mechanical general-purpose computer, the Analytical Engine. Her notes on the engine include what is now recognized as the first algorithm intended to be processed by a machine.
  • Grace Hopper - A rear admiral in the U.S. Navy, she was a pioneer in computer programming and was one of the first programmers of the Harvard Mark I computer. She also developed the first compiler for a computer programming language and conceptualized the idea of machine-independent programming languages, which led to the development of COBOL.
  • Edith Clarke - The first woman to earn an electrical engineering degree from MIT, Clarke invented a graphical calculator that g
@brennanMKE
brennanMKE / DispatchTime.swift
Created May 23, 2017 18:20
DispatchTime Addition with Seconds
import Foundation
// Note: DispatchTime has a custom addition operator which allows for
// adding seconds as a Double to DispatchTime with is represented in
// nanoseconds which is a time scale of 1 billion for each second.
let seconds: TimeInterval = 5.0
let now = Double(DispatchTime.now().rawValue)
let later = Double((DispatchTime.now() + seconds).rawValue)
@brennanMKE
brennanMKE / EventEmitter.swift
Last active March 7, 2024 04:04
React Native Event Emitter for RCTEventEmitter in Objective-C and Swift
class EventEmitter
/// Shared Instance.
public static var sharedInstance = EventEmitter()
// ReactNativeEventEmitter is instantiated by React Native with the bridge.
private static var eventEmitter: ReactNativeEventEmitter!
private init() {}
@brennanMKE
brennanMKE / README.md
Created February 20, 2024 18:09
Noisebridge Rules

Noisebridge Rules

The top rule is Be Excellent. All rules that follow are examples of not being excellent.

Is there a no sleeping rule at Noisebridge? What about living in the space?

Yes, Noisebridge has a policy against sleeping and living in the space. This is to ensure that the space remains available and accessible for the community's intended purpose: collaboration, learning, and making. The rule is in place to maintain a productive environment and to comply with legal and safety regulations. Noisebridge is dedicated to being a welcoming and active makerspace, and as such, it is not designed to support living accommodations. If you have specific questions about this policy or need clarification on acceptable use of the space, I can provide more detailed information from Noisebridge's guidelines and policies.

What is to be done when someone is sleeping or living in the space?