Delete Git Branches That Have Been Merged
Dave Ceddia's Blog
by Dave Ceddia
1y ago
Got a lot of old git branches hanging around? Here’s a little script that will delete the branches that have been marged. It’ll print out the branches to be deleted, and then prompt for whether you want to delete them. If your top-level branch isn’t called “main”, customize the MAIN variable to match. Script: Delete old git branches #!/bin/bash # Change this to match the name of your top level branch MAIN=main echo "These branches have been merged into $MAIN and will be deleted:" echo git branch --merged $MAIN | grep -v "^\* $MAIN" echo read -p "Continue? [y/N] " -n 1 -r echo if [[ ! $REP ..read more
Visit website
How to Run SketchUp Make 2017 on an M1 Mac with macOS Monterey
Dave Ceddia's Blog
by Dave Ceddia
1y ago
I tried to run the old standalone version of SketchUp Make 2017 on my modern M1 Mac running macOS Monterey 12.4 recently. At first it went pretty badly, crashing on startup with the error “SketchUp quit unexpectedly.” But I got it working! Here’s how to get it running by removing the code signature. The main clue came when I tried running it from the Terminal, to see if it would show a more useful error. I got the same popup error, but also this: rosetta error: /var/db/blahblah/SketchUp.aot: attachment of code signature supplement failed: 1 zsh: trace trap /Applications/SketchUp\ 2017/Sket ..read more
Visit website
Installing a Code Signing Cert from Sectigo (to sign an Electron app on Windows)
Dave Ceddia's Blog
by Dave Ceddia
2y ago
So, you bought a code signing certificate for your Electron app. One step closer to being able to release your app on Windows. Congrats! Finally, 3 weeks later, after a few phone calls, Sectigo issued the certificate. Woohoo! The email went to spam and you didn’t see it for 3 days, but hey, we’re making progress. In their email, they say in big red letters that you must use Internet Explorer to download it (or an ancient version of Firefox). And then you try that, and it fails. Because when you ordered the cert, you didn’t use the on-page tool that required using an ancient web browser. You us ..read more
Visit website
Implementing A Svelte Store In Rust
Dave Ceddia's Blog
by Dave Ceddia
2y ago
We’re going to build a Svelte store, written in Rust, and run it in an Electron app. This spun out of a video editor which I originally built in Swift. It turns out people on Windows want to edit videos too, so now I’m rewriting it with Rust, Electron, and Svelte with an eye for performance. Rust is a systems programming language, akin to C or C++, but safer. It’s known for being super fast. Electron is a framework for building cross-platform desktop apps with HTML, CSS, and JavaScript. It’s known for being kinda slow and bloaty. But there’s an ace up its sleeve: Electron apps can be extended ..read more
Visit website
Interview Questions to Ask Your Interviewer
Dave Ceddia's Blog
by Dave Ceddia
2y ago
On Twitter, Kyle Shevlin was talking about how at the end of a software engineering interview, they’ll often offer a painfully-small amount of time to ask some of your own questions. The worst part is, I often just blank in the 5 minute question time. I’ll come up with something because I’m good on my feet, but deep down it feels ineffectual. I’m not getting what I need in that time period, so let me just use the bathroom before the next interview. — @kyleshevlin I mentioned that I had a go-to list of questions that I literally printed and brought with me, and would bring out during this 5-m ..read more
Visit website
Attach VSCode Debugger to native Rust in an Electron app
Dave Ceddia's Blog
by Dave Ceddia
2y ago
I’ve been working on a video editor built on top of Electron and Rust, where Rust does the heavy lifting, and Electron (paired with Svelte) takes care of the UI. Debugging the JS is easy enough: pop open Electron’s devtools, set some breakpoints, and you’re off to the races. Debugging the Rust is a little harder. But it’s possible! Here’s my setup for attaching VSCode’s debugger to the native Rust code, which is running within Electron’s renderer process. Set up launch.json VSCode’s debugger relies on a config file called launch.json. I think it can reside in a few different places; mine is in ..read more
Visit website
Example of Using napi-rs with Electron
Dave Ceddia's Blog
by Dave Ceddia
2y ago
You can improve the performance of your Electron apps quite a bit by offloading intensive tasks to Rust. There are 2 main libraries out there to help you do this: Neon and napi-rs. As it stands today, Neon is more popular, with over 5700 stars on Github, whereas napi-rs has only a little over 800. That said, stars aren’t everything! For my use case (and as of this writing) napi-rs supports an important feature that Neon doesn’t have yet: the ability for Rust to call back to a JS callback function multiple times. I went in search of a minimal starter project to get going with Electron + napi-rs ..read more
Visit website
Escape Liquid in ConvertKit (so you can use double braces)
Dave Ceddia's Blog
by Dave Ceddia
2y ago
Need to use double braces in your ConvertKit email? Maybe you’re trying to write some code, and the braces are getting stripped out along with everything inside. Here’s the easy fix: Before the opening double braces, add {% raw %}. After the closing braces, add {% endraw %}. Example of Escaping Double Braces in ConvertKit Liquid I had this problem myself – some of my email content was getting stripped out, ending up like this: <CustomButton green={true} width={64} options= onClick={doStuffFunc} /> And here’s what it was supposed to be, with more text on the options= line: &l ..read more
Visit website
How to Manually Symbolicate a Crash Log from a macOS App
Dave Ceddia's Blog
by Dave Ceddia
3y ago
Is one of your Mac apps crashing? If you got a crash report from your users, or an unsymbolicated crash log from Sentry, I’ll walk you through how to decode it into something you can use to debug the crash. For my own app Recut, I’ve added the Sentry library to capture crash reports. For whatever reason, Sentry does not symbolicate my crash reports. I’ve uploaded the dSYMs and it just seems to ignore them. So: I’ll just symbolicate them myself! Here’s how to do it manually. I also put together a Ruby script to symbolicate the whole crash report too. 1. Download the unsymbolicated crash report ..read more
Visit website
Using Forms in React
Dave Ceddia's Blog
by Dave Ceddia
3y ago
No matter what kind of app you’re writing, there’s a good chance you need at least one form. Forms in React are often a pain, filled with verbose and boilerplate-y code. Let’s look at how to make forms in React with less pain. In this article we’ll be focusing on using plain React, with no libraries. You’ll learn how forms really work, so you can confidently build them yourself. And if later you choose to add a form library, you’ll know how they work under the hood. We’re going to cover: How to create React forms without installing any libraries The two styles of inputs in React forms When to ..read more
Visit website

Follow Dave Ceddia's Blog on FeedSpot

Continue with Google
Continue with Apple
OR