Skip to content

Instantly share code, notes, and snippets.

View dasmurphy's full-sized avatar

Torsten Stelling dasmurphy

View GitHub Profile
@gitname
gitname / README.md
Last active October 18, 2023 11:23
Using `@react-pdf/renderer` with React 18

Using @react-pdf/renderer v3.0.1 with React 18

Introduction

When I tried to use the @react-pdf/renderer package (version 3.0.1) with a React 18 app, two problems arose. In this article, I'll describe those problems and tell you how I solved them.

Update: Here's a video demonstration of the problems and solution described in this article: https://youtu.be/YZP5r7Uy_bU

Problem 1: Dependency Conflict

@luckman212
luckman212 / rgr
Created December 23, 2021 18:25
rgr: quick in-place search and replace using ripgrep + gsed
#!/usr/bin/env bash
case $1 in
-h|--help|'') echo "usage: ${0##*/} <old> <new>"; exit;;
esac
export old="\b$1\b"
export new=$2
rg --files-with-matches -0 "${old}" |
@luckman212
luckman212 / devteamid.sh
Created December 23, 2021 16:21
grab Apple DEVELOPMENT_TEAM ID from Keychain
#!/usr/bin/env bash
#requires openssl@3 from Homebrew
_openssl=$(brew --prefix openssl 2>/dev/null)/bin/openssl
[[ -x $_openssl ]] || { echo "missing openssl, try \`brew install openssl\`"; exit 1; }
#find development cert
id=$(security find-identity -v -p codesigning | head -1)
[[ -n $id ]] || exit 1
cn=$(sed -En 's/^.*Apple Development.*\((.*)\).*$/\1/p' <<<"$id")
@leimao
leimao / jpeg2pdf.sh
Last active November 20, 2022 13:57
JPEG to PDF Conversion
# MIT License
# Copyright (c) 2021 Lei Mao <https://leimao.github.io/>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@anonymous1184
anonymous1184 / README.md
Last active January 19, 2024 04:58
WinHttpRequest.ahk

WinHttpRequest Wrapper

Usage and information: https://redd.it/mcjj4s

AutoHotkey v2.0

  • [WinHttpRequest.ahk]

AutoHotkey v1.1

@april
april / arena-macos-fixes.sh
Last active March 14, 2024 04:48
Fixes Magic Arena's broken full screen implementation on macOS
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
# to find the scaled resolutions, go to System Preferences --> Display and then
# divide the width by 16 and multiple by 9. on my personal system this ends up
@zerebral
zerebral / page-load-test.js
Last active September 16, 2022 07:43
Puppeteer | Wait till all content is loaded in the browser
const waitTillHTMLRendered = async (page, timeout = 30000) => {
const checkDurationMsecs = 1000;
const maxChecks = timeout / checkDurationMsecs;
let lastHTMLSize = 0;
let checkCounts = 1;
let countStableSizeIterations = 0;
const minStableSizeIterations = 3;
while(checkCounts++ <= maxChecks){
let html = await page.content();
@ayyybe
ayyybe / ccdl.command
Last active May 2, 2024 16:08
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@Kiran-B
Kiran-B / DeveloperColorPicker.colorPicker-macOS-Catalina.md
Last active February 17, 2024 10:56
Making Panic's Developer ColorPicker (DeveloperColorPicker.colorPicker) work in macOS BigSur & macOS Catalina

Context

Panic's Developer ColorPicker (v1.5.4) does not work in macOS Catalina or macOS BigSur. This is due to enforcement of code-signing. Until Panic releases a newer version that supports Catalina/BigSur, below is the workaround.

Prerequisite

You need a Developer Account. This could be a free account. Refer: https://9to5mac.com/2016/03/27/how-to-create-free-apple-developer-account-sideload-apps/

Get the latest version of developer-color-picker

https://panic.com/blog/developer-color-picker-1-5/

@kevinelliott
kevinelliott / 1-macOS-10.15-catalina-setup.md
Last active March 5, 2024 23:30
macOS 10.15 Catalina Mostly-Automated Setup

To support my open-source work, consider adding me on Patreon.

macOS 10.15 Catalina Mostly-Automated Setup

An easy to refer to document for regularly setting up macOS 10.15 Catalina.

Controversy

The topic of recipe-based frequent fresh reinstalls of macOS is a controversial issue. Some people are against reinstalling macOS, citing that they have never had an issue with Apple provided upgrade installs.