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 / app.js
Created February 3, 2023 21:27 — forked from MattSandy/app.js
Tweet Scraper in Node.JS
var Twitter = require('node-tweet-stream')
, t = new Twitter({
consumer_key: '',
consumer_secret: '',
token: '',
token_secret: ''
});
var watch = [
"SB52",
"SBLII",
@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"
@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 / main.dart
Last active November 3, 2022 17:52
Fibonacci
// Copyright 2022 @RandyMcmillan. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'dart:math';
void main() {
var i = 5;
var p = pow(2,i);
@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_disable_airplay.sh
Last active September 8, 2023 20:31
MacOS: toggle "AirPlay Receiver" in "System Preferences" pane id "com.apple.preferences.sharing"
#!/bin/bash
osascript <<EOS
on toggle()
tell application "System Preferences" to reveal pane id "com.apple.preferences.sharing"
tell application "System Events" to tell window 1 of application process "System Preferences"
repeat until exists checkbox 1 of (first row of table 1 of scroll area 1 of group 1 whose value of static text 1 is "AirPlay Receiver")
@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