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 / 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 / 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 / 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 / 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
# 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 / 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
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 / 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)
@RandyMcMillan
RandyMcMillan / nodecheck.sh
Created November 8, 2022 16:23 — forked from jamesmcintyre/nodecheck.sh
bash script to check node/npm version and installed deps against package.json requirements
# more extensive check intended for scenerios such as pulling an existing repo you're unfamiliar with, pulling down changes
# and wanting to ensure your current node_modules/ is up-to-date with any package.json changes, etc.
# you will automatically be prompted to install the two required global npm modules
nodecheck() {
printf "\n\n"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' .
printf "ENVIRONMENT:\n"
@RandyMcMillan
RandyMcMillan / cargo.toml
Last active December 12, 2022 21:20 — forked from futurepaul/example.rs
example usage of miniscript
[dependencies]
miniscript = { git="https://github.com/apoelstra/rust-miniscript", features=["compiler"] }
bitcoin = "0.18"
secp256k1 = "0.12"