Skip to content

Instantly share code, notes, and snippets.

View a-r-d's full-sized avatar
🍌

Aaron Decker a-r-d

🍌
View GitHub Profile
@a-r-d
a-r-d / check-addr-from-xpub.py
Last active October 26, 2023 03:30
How to correctly check a native segwit address if its derived from an a given xpub
"""
This works as of October 2023
pip3 install bitcoinlib
"""
from bitcoinlib.keys import HDKey
def check_address_in_xpub(xpub, address_to_check, segwit_type):
@a-r-d
a-r-d / convert-and-split.sh
Last active August 2, 2023 20:46
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
#first install all the things:
sudo apt-get install flac ffmpeg mp3splt libav-tools shntool
# Okay first lets do an MP3:
# input files:
# --> cd.ape
# --> cp.cue
# (there are other options, like bitrate, but this is just the bare bones)
avconv -i cd.ape cd.mp3
@a-r-d
a-r-d / memory.md
Created January 30, 2018 16:15
A million ways to change HEAP memory in Java

Xmx vs Xms

Remember, Xmx corresponds to max heap and Xms corresponds to starting heap. It can be an optimization to set these equal.

In Spring Boot build.gradle

bootRun {
      jvmArgs = ['-Xmx1g']
}
@a-r-d
a-r-d / brute.rb
Created November 9, 2013 21:19
Really slow brute forcer for encrypted wallet. If you forget it and know the beginning of the password you may be able to get it. However this can only try 10 passwords a second :( Adapted from a script posted on bitcointalk.
#!/usr/bin/ruby -w
=begin
How to use, windows:
go to C:/Program Files (x86)/Bitcoin/daemon/
and execute ".\bitcoin -help"
You will need to create bitcoin.conf file @:
C:\Users\usr\AppData\Roaming\Bitcoin
@a-r-d
a-r-d / index.html
Last active June 24, 2022 14:34
canvas sprite sheet demo
<html>
<head>
<title>Canvas Boilerplate</title>
<style type="text/css">
*,html{
margin: 0;padding: 0;
}
canvas {
width: 100%;
@a-r-d
a-r-d / keybase.md
Created July 15, 2021 22:00
keybase

Keybase proof

I hereby claim:

  • I am a-r-d on github.
  • I am a_r_d (https://keybase.io/a_r_d) on keybase.
  • I have a public key ASD4gHJYd1VQoZ7CBS4AH1UQJjHXMOzniVPPT-TKpCXZWgo

To claim this, I am signing this object:

@a-r-d
a-r-d / hold-tlt-version.py
Last active May 18, 2021 13:40
QuantConnect - simple MACD strategy against SPY, 50/150 day cross, long and short, leverage is none
import numpy as np
### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
const Alpaca = require('@alpacahq/alpaca-trade-api')
const getKeyId = () => process.env.APCA_API_KEY_ID
const getSecretKey = () => process.env.APCA_API_SECRET_KEY
export const alpaca = new Alpaca({
keyId: getKeyId(),
secretKey: getSecretKey(),
paper: false,
usePolygon: false,
@a-r-d
a-r-d / other-misc-data-assets-v1-INVALID.json
Last active June 18, 2020 20:37
data asset demo public
[
{"Country Code":"USA","Established Customers":"5009","Total Customers":"3900343","Pct Active Accounts":"90"},
{"Country Code":"CAN","Established Customers":"3389","Total Customers":"300043","Pct Active Accounts":"80"},
{"Country Code":"MEX","Established Customerz":"2890","Total Customers":"zzzz","Pct Active Accounts":"70"}
]
@a-r-d
a-r-d / 10leds.ino
Created June 2, 2012 06:07
10 LED bar graph code for Arduino uno.
/*
Little code for my 10 LED bar graph.
This is just a basic outline for making all the segments light up at diff. intervals.
looks OK but not super organized.
*/
int numPins = 10;
int ledPins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int ledStates[] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};