Skip to content

Instantly share code, notes, and snippets.

View alexanderjsingleton's full-sized avatar

Alex Singleton alexanderjsingleton

View GitHub Profile
@alexanderjsingleton
alexanderjsingleton / README.md
Last active December 6, 2023 23:49
Bitcoin mining with Raspberry Pi and Slushpool

After spinning-up your Raspberry Pi and registering an account at slushpool:

  1. sudo apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++ git
  2. git clone https://github.com/tpruvot/cpuminer-multi
  3. cd cpuminer-multi
  4. ./autogen.sh
  5. ./build.sh
  6. Check out the commands: ./cpuminer --help
  7. ./cpuminer -u slashpool_user_name.slashpool_worker -p pass -a sha256d -o stratum+tcp://stratum.slushpool.com:3333 -t cputhreads
  8. Order MOAR Raspberry Pi's and Antminers then buy more Bitcoin.
@alexanderjsingleton
alexanderjsingleton / create.sql
Created May 16, 2017 19:01
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
CREATE TABLE VEHICLE
(
VIN VARCHAR(30) NOT NULL,
Make VARCHAR(30) NOT NULL,
Model VARCHAR(30) NOT NULL,
Year INT NOT NULL,
Color CHAR(30) NOT NULL,
LicensePlate VARCHAR(20) NOT NULL,
Mileage INT NOT NULL,
PRIMARY KEY (VIN),
@alexanderjsingleton
alexanderjsingleton / create.sql
Created May 16, 2017 19:01
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
CREATE TABLE VEHICLE
(
VIN VARCHAR(30) NOT NULL,
Make VARCHAR(30) NOT NULL,
Model VARCHAR(30) NOT NULL,
Year INT NOT NULL,
Color CHAR(30) NOT NULL,
LicensePlate VARCHAR(20) NOT NULL,
Mileage INT NOT NULL,
PRIMARY KEY (VIN),
@alexanderjsingleton
alexanderjsingleton / insert.sql
Last active May 16, 2017 18:59
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
/* This section populates the Customers table */
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000001, 'John', 'Constantine', 'jconstantine@jld.org', '999990013', '0000013');
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000002, 'Hal', 'Jordan', 'hjordan@glcorps.org', '999990001', '0000001');
INSERT INTO CUSTOMER (CustomerID, CustomerFName, CustomerLName, CustomerEmail, DriversLicense, RewardNumber)
VALUES (000003, 'Barry', 'Allen', 'ballen@jla.org', '999990002', '0000002');
@alexanderjsingleton
alexanderjsingleton / reporter.sql
Created May 16, 2017 16:37
A GWMSIST graduate research project demonstrating iterative database administration, design and modeling.
-- Oldest Reservation
SELECT * FROM RESERVATION
WHERE Pick_Up_Date = (SELECT MIN(Pick_Up_Date) FROM RESERVATION);
-- Customer Reservations with Make and Model of Vehicle
SELECT CUSTOMER.CustomerID, CUSTOMER.CustomerFname AS First_Name, CUSTOMER.CustomerLname AS Last_Name, RESERVES.VIN, VEHICLE.Make, VEHICLE.Model
FROM (((CUSTOMER
INNER JOIN RESERVATION ON CUSTOMER.CustomerID = RESERVATION.CustomerID)
@alexanderjsingleton
alexanderjsingleton / OhMyZshConfig.md
Last active December 27, 2016 20:43
Easiest way to install OhMyZsh as your terminal-shell
  1. Assuming git is installed, git clone git://zsh.git.sf.net/gitroot/zsh/zsh
  2. curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  3. chsh -s /bin/zsh
  4. Restart terminal.
  5. cd ~/zsh and verify install!
@alexanderjsingleton
alexanderjsingleton / sublime-instructions.md
Last active December 4, 2016 18:59
How to create Sublime short-cut in terminal via bash-profile in Mac OS X Sierra.

Sublime Text Shortcut Guide

  1. Open Mac Terminal
  2. Go to homebrew.sh; copy and enter the following: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Enter brew install wget
  4. Enter the following into your Mac Terminal: open ~/.bash_profile but if for whatever reason you don't have one configured, enter sudo nano .bash_profile.
  5. To become sufficiently Rubified: brew install ruby
  6. Download Sublime Text 3 then go to root/usr (e.g. cd alexanderjsingleton/).
@alexanderjsingleton
alexanderjsingleton / Facebook360JSExample.js
Created August 29, 2016 21:09
WordPress * Facebook360 Integration for Embed
<script>window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v2.5'
});
}; (function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
@alexanderjsingleton
alexanderjsingleton / phone-number-regex.gsheet
Last active May 28, 2016 01:16
Assuming column C contains different phone-number formats, insert the following regex in adjacent column D2 for uniform formatting.
=ArrayFormula(replace(replace(regexreplace(C2:C&"","[-/. ()]",""),4,0,"-"),8,0,"-"))
@alexanderjsingleton
alexanderjsingleton / plsql.sql
Last active May 13, 2016 22:21
A simple Oracle PL/SQL statement provided for [my blog-post on databases](https://www.alexanderjsingleton.com/event-horizon-data-centric-future)
-- An Oracle PL/SQL example for my blog-post:
CONNECT ap/ap;
SET SERVEROUTPUT ON
declare
min_invoice_total ap.invoices.invoice_total%TYPE;
max_invoice_total ap.invoices.invoice_total%TYPE;
begin
SELECT MIN(invoice_total), MAX(invoice_total) INTO min_invoice_total,max_invoice_total
FROM ap.invoices;