Skip to content

Instantly share code, notes, and snippets.

View BaReinhard's full-sized avatar
🏠
Working from home

Brett Reinhard BaReinhard

🏠
Working from home
  • Los Angeles
View GitHub Profile
@BaReinhard
BaReinhard / enUS_Path of Diablo Install.sh
Last active September 14, 2020 16:18
Simple install and download of Path of Diablo for Mac OS
PLEASE REFER TO https://github.com/BaReinhard/pod-installer-utils
@BaReinhard
BaReinhard / update_trades.js
Last active May 25, 2020 13:34
Update trades Path of Diablo
function postData(url = ``, data = {}) {
// Default options are marked with *
return fetch(url, {
method: "POST", // *GET, POST, PUT, DELETE, etc.
headers: {
Cookie:
"COOKIE_GOES_HERE",
"Content-Type": "application/json",
"X-XSRF-TOKEN":
"TOKEN_GOES_HERE"
func threeSum(nums []int) [][]int {
sort.Ints(nums[:])
used:= map[string]bool{}
if !(len(nums)>2){
fmt.Printf("Not enough integers in array")
return [][]int{}
}
firstNum:= nums[0]
lastNum:= nums[len(nums)-1]
// Check that the sorted list to see if its a long array of 0's
/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
// Check that l1 and l2 are not empty
func reverse(x int) int {
// calc minimum and maximum values
max:= int(math.Pow(2,31))
min:= int(math.Pow(-2,31)) -1
tmp := x
reverse:= 0
for{
digit := tmp % 10
reverse = reverse * 10 + digit
tmp = tmp / 10
// pseudo code
// strip string of white space
// check first character for sign
// loop through remaining string until the end or a non integer value
// check ascii value of each character and ensure it falls in proper range
// then offset the ascii value from the ascii of 0
// return new integer with sign 1 or -1
func myAtoi(str string) int {
finalString:= ""
sign:= 1
/*
* LedBrightness sketch
* controls the brightness of LEDs on "analog" (PWM) output ports.
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,9,4,8,7);
class rgb_color {
private:
int my_r;
//Program: RGB Color Change
//Programmer: Brett Reinhard
//Date: 03/12/2016
//Description: Changes color of rgb led by use of a potentiator knob.
int prevR = 0, prevG = 0, prevB = 0; // all of the previous RGB values
int const Red = 3; //pin 3
int const Blue = 5; // pin 4
//Program: RGB Color Change
//Programmer: Brett Reinhard
//Date: 10/20/2016
//Description: Changes color of LED's within the Pumpkin, with smooth transitions.
int const Red = 9, /* Pin 3 */ Blue = 11, /* Pin 5 */ Green = 10; /* Pin 6 */
class Pumpkin
{
private:
int *_r;
int *_g;
@BaReinhard
BaReinhard / download_files.sh
Last active September 14, 2020 16:19
File downloader for xml links for Path of Diablo (for mac users, should also work for linux, given you have xmlstarlet installed)
PLEASE REFER TO https://github.com/BaReinhard/pod-installer-utils