Skip to content

Instantly share code, notes, and snippets.

View aprivette's full-sized avatar

Adam Privette aprivette

  • First Arriving
  • Richmond, Virginia
View GitHub Profile
@aprivette
aprivette / asound-8ch-to-4x-stereo.conf
Created May 3, 2024 19:35
Alsa stereo audio config written for HifiBerry's DAC 8X - Mirrors stereo playback over all 4 3.5mm ports
# /etc/asound.conf
pcm.!default {
type plug;
slave.pcm stereoA;
}
ctl.!default {
type hw card 0;
}
@aprivette
aprivette / CurlSort.php
Last active January 26, 2023 18:46
Trash attempt at designing an esoteric sorting algorithm
<?php
/**
Introducing Curl Sort, an esoteric sorting algorithm.
1. For every x element in an array, construct a cURL request to a closed port on any server.
2. Set the timeout on each request to x seconds, respectively.
3. Fire all requests simultaneously and print out their duration as they complete.
*/
@aprivette
aprivette / imagick-overlay.php
Created December 10, 2017 23:08
Overlays an image and stretches it to 4 points using the Imagick PHP library. Originally created to place ads on photos of billboards.
<?php
// IMAGE DISTORTING AND COMBINING ADVENTURES
// PROUDLY ACCOMPLISHED IN THE MIDDLE OF THE NIGHT ON A FRIDAY
// LOAD BILLBOARD IMAGE
$image_in = new imagick( __DIR__."/overlay.jpg" );
// LOAD SCENE IMAGE
$image_scene = new imagick( __DIR__."/background.jpg" );
@aprivette
aprivette / binance-calc
Created December 10, 2017 23:04
A bash script to help you set limit orders on Binance (cryptocurrency exchange). Takes a coin ID and a target price in USD as input.
#!/bin/bash
# Binance Calculator
# Created by Adam Privette (https://github.com/aprivette)
#
# Intended to help set limit buy/sell orders on Binance by providing metrics on a target price.
# Retrieves current USD value of the coin, projected BTC value of the coin based on target price, and offset percentage of the target price
# Example usage: binance-calc IOTA 4.53
# Check for arguments
if [ -z "$2" ]; then