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 / Readme.md
Created June 3, 2012 18:41
Push email to arduino-> to LED ASCII display
@a-r-d
a-r-d / excelReader.vb
Created April 4, 2012 04:43
Excel file report generator Outline/ template script. Form layout not included!
'WHAT IS THIS?
' -opens an excel file with named cells, reads them from the specified sheet,
' then it will save this to another file. Basically this a template for
' generating reports from a large excel file that can be sent to people that only
' need minimal information
'microsoft tut
'http://support.microsoft.com/kb/302094
'also add COM Reference "Microsoft Excel Object Library 14"
@a-r-d
a-r-d / fade_complex.ino
Created December 8, 2018 19:48
Some RGB fade arduino code
/*
* Code for cross-fading 3 LEDs, red, green and blue (RGB)
* To create fades, you need to do two things:
* 1. Describe the colors you want to be displayed
* 2. List the order you want them to fade in
*
* DESCRIBING A COLOR:
* A color is just an array of three percentages, 0-100,
* controlling the red, green and blue LEDs
*
@a-r-d
a-r-d / main.py
Created February 22, 2018 01:42
Basic sector rebalance monthly algorithm
import numpy as np
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
'''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.SetStartDate(2004, 1, 1) #Set Start Date
self.SetEndDate(2018, 2, 16) #Set End Date
self.SetCash(100000) #Set Strategy Cash
@a-r-d
a-r-d / mailer.php
Created November 11, 2012 20:20
bitcoin mining status checker for slush's pool
<?php
/*
What: mailer script for notifications:
Required params under POST:
msg
sub
ret
pass
@a-r-d
a-r-d / readme.md
Last active May 13, 2018 01:14
LCD + Arduino + Python serial code. Small arduino program to read in lines off of the serial port from a python program and write it to the LCD. I have a method to do the scrolling, and a way to determine which lines you are sending so it goes on the right line. Eventually this will pull down my credit card info and figure out how much I have le…

LCD + Arduino + Raspberry PI

The LCD module is attached via 2 analog pins to the Arduino board.

The arduino board listens for serial data coming in that starts with a line number, it will then send it on its way to the correct line, while calculating what substring it needs to display on the LCD.

The raspberry pi is running the python script that is doing the sending. The raspberry pi has

@a-r-d
a-r-d / playing_with_elevatr.R
Last active April 10, 2018 17:40
playing with elevatr public AWS data not authed
library(rgdal)
library(elevatr)
# this is the prjection system given as example in the documentation
ll_prj <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
# Im using this projection system based on reading this document:
# https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/OverviewCoordinateReferenceSystems.pdf
us_prj = "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
@a-r-d
a-r-d / dedupe-array-of-objects.js
Created December 8, 2015 15:21
Deduplicate an array of objects in javascript
function deDupeArrayOfObjects(arr) {
var tmpMap = {};
arr.forEach(function(val) {
var uniquekey = '';
for(var k in val) {
if(val.hasOwnProperty(k) && val[k]) {
uniquekey += val[k].toString();
}
}
tmpMap[uniquekey] = val;
@a-r-d
a-r-d / scale.py
Created March 8, 2018 20:25
how to scale factors
def featureScaling(arr):
_max = 0
_min = 10000000
for a in arr:
if a < _min:
_min = a
if a > _max:
_max = a
scaled = []
@a-r-d
a-r-d / ssh-tunnel.sh
Last active January 29, 2018 11:07
how to open a remote tunnel for cassandra
# cassandra runs on 9042 for devCenter management
# expose it (9999 locally) running on a remote server locally:
ssh -L 9999:localhost:9042 -f -N remoteuser@remotehost