Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / gist:17dd8281ade57e87696011eb29e55776
Created November 2, 2022 19:44 — forked from ShaoJenChen/gist:8ae9728939061ed4a3d4a63d01f7d404
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. https://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
import SwiftUI
struct SplitView: View {
@State var selected: Int? = nil
var body: some View {
HStack {
List(0...10, id: \.self, selection: $selected) { number in
HStack {
@RandyMcMillan
RandyMcMillan / macOS_SytemPrefs.md
Created August 9, 2022 17:33 — forked from rmcdongit/macOS_SytemPrefs.md
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
# this function is a ticket to hell, each time you connect
# somewhere, it records a log of when you connect and disconnect
ssh() {
# create a file, for ssh to let us know the hostname
ssh_hostname_tmp=$(mktemp)
ssh_username_tmp=$(mktemp)
ssh_port_tmp=$(mktemp)
# why do I need a fifo, see below, hint: controll flow from hell
@RandyMcMillan
RandyMcMillan / secp256k1.rb
Last active July 28, 2022 00:06 — forked from shazow/secp256k1.rb
Homebrew recipe for secp256k, put it into /usr/local/Library/Formula/secp256k1.rb or run: brew install https://gist.github.com/RandyMcMillan/9ed160ca1ceba5ae49e1ea7d019a16cf#file-secp256k1.rb
class Secp256k1 < Formula
desc "Optimized C library for EC operations on curve secp256k1"
homepage "https://github.com/bitcoin/secp256k1"
url "https://github.com/bitcoin/secp256k1.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
@RandyMcMillan
RandyMcMillan / node-and-npm-in-30-seconds.sh
Created March 12, 2022 19:00 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@RandyMcMillan
RandyMcMillan / git-remove-file.sh
Created March 9, 2022 17:01 — forked from bartlomiejdanek/git-remove-file.sh
remove file from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@RandyMcMillan
RandyMcMillan / main.cpp
Created November 18, 2021 19:47 — forked from peteristhegreat/main.cpp
QHoverEvent in a QPushButton (and leaveEvent and enterEvent)
#include <QApplication>
#include "mypushbutton.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyPushButton pb;
pb.show();
return a.exec();
}
@RandyMcMillan
RandyMcMillan / bitcoind-ubuntu-install
Created November 14, 2021 06:23 — forked from rjmacarthy/bitcoind-ubuntu-install
Install Bitcoind Ubuntu
** Add repository and install bitcoind **
sudo apt-get install build-essential
sudo apt-get install libtool autotools-dev autoconf
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install bitcoind
mkdir ~/.bitcoin/ && cd ~/.bitcoin/
@RandyMcMillan
RandyMcMillan / setup-cross-cc.sh
Last active November 18, 2022 02:09 — forked from xentec/setup-cross-cc.sh
Alpine Linux cross-compiler setup script
#!/bin/sh
CTARGET="$1"
if [ -z "$CTARGET" ]; then
program=$(basename $0)
echo "usage: $program TARGET_ARCH"
return 1
fi
# get abuild configurables