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 / p618.py
Created July 28, 2021 18:30 — forked from igorvanloo/p618.py
Problem 618
def compute(limit):
d = [1] + [0] * limit
primes = eulerlib.primes(limit)
mod = 10**9
Fibonnaci_numbers = [2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368]
for p in primes:
for i in range(p,limit+1):
d[i] += (p*d[i-p] % mod)
@RandyMcMillan
RandyMcMillan / bitcoin-pay.rb
Created July 14, 2021 06:07 — forked from Sjors/bitcoin-pay.rb
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
@RandyMcMillan
RandyMcMillan / mingw-w64-4.0.4-osx10.11.2.sh
Created April 19, 2021 03:08 — forked from cosmo0920/mingw-w64-4.0.4-osx10.11.2.sh
Script to install a Mingw-w64 Cross-Compiler Suite on Mac OS X 10.11.2
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew tap homebrew/versions
#!/usr/bin/env ruby
# Usage: githubify <gemspec_file> [username]
# Requires: github.name to be set for the current git project or [username] to be specified
# Result: creates/overwrites a file named <username>-<gemspec_file> and updates the s.name in there have the same project name format.
#
# Author: Wes Oldenbeuving
# E-mail: narnach@gmail.com
# License: MIT-LICENSE
class String
@RandyMcMillan
RandyMcMillan / README.md
Created June 24, 2020 08:26 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@RandyMcMillan
RandyMcMillan / howto_create_online_radio_macos_sierra.txt
Created March 5, 2020 20:51 — forked from dmpanch/howto_create_online_radio_macos_sierra.txt
How to create internet radio on MacOS Sierra 10.12
All actions are performed in Terminal.app.
1. Install Homebrew http://brew.sh/
2. Install Jack (route audio tool) http://jackaudio.org/. Current stable version from official website doesn't work with
MacOS Sierra (I use 10.12.3) so you need to download beta version from there https://yadi.sk/d/JwT10b7v3Dm5yy.
After installing reboot your computer.
3. Install Darkice (audio streamer) via brew.
@RandyMcMillan
RandyMcMillan / disable.sh
Last active February 25, 2020 05:34
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
@RandyMcMillan
RandyMcMillan / install ncurses on macosx
Created January 27, 2020 22:25 — forked from cnruby/install ncurses on macosx
HOW TO INSTALL ncurses on MacOSX
$ curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
$ tar -xzvf ncurses-5.9.tar.gz
$ cd ./ncurses-5.9
$ ./configure --prefix=/usr/local \
--without-cxx --without-cxx-binding --without-ada --without-progs --without-curses-h \
--with-shared --without-debug \
--enable-widec --enable-const --enable-ext-colors --enable-sigwinch --enable-wgetch-events \
&& make
$ sudo make install
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#