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 / min_col_finder.vba
Created November 7, 2012 17:22
Excel VBA macro to help find the lowest price amount vendors for many items.
Sub loopToFindMinColName()
'
' Finds the column name of something
'
' you must give the correct sheet name
sheetName = "Vendor Pricing"
'This is the columne where minimum is listed
minCol = "D"
@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 / bubble_sort.py
Created November 24, 2012 19:13
Sorting algorithms implemented in python (as a test before reading algo book)
# the bubble sort
l = [1,3, 5, 4, 2, 9, 7, 23, 15, 8, 4]
print l
loops = 0
length = len(l)
while 1:
sorted = False
i = 0
for x in l:
@a-r-d
a-r-d / renamer.py
Created December 15, 2012 02:56
Renames all files in a dir. Somebody needed this @ work
#!/usr/bin/python
#
# Simple file renamer- renames all files in a dir. skips directories, keeps extensions.
# Takes a full path.
#
# Some sales person needed this at work for something.
# Aaron Decker - [email protected]
# MIT License
#
import os
@a-r-d
a-r-d / del_and_touch_all.py
Created January 3, 2013 22:45
Touches all files in a directory to zero bytes. Haha just something I use for backups to make it ignore my .vrb files. Kinda dumb but it does the job. It holds your hand also so you dont acidentally your whole system when you are ssh'd in somewhere as root.
#!/usr/bin/python
#
# Dels all files in a dir.
# Then, it will touch an empty file for all of the same name!.
#
# Some sales person needed this at work for something.
# Aaron Decker - [email protected]
# MIT License
#
import os
@a-r-d
a-r-d / swap_meta_tags.php
Created January 9, 2013 21:31
Just a little PHP script that could go on a site global header that swaps meta tags based on script name. Wrote for work, could re use later.
<?php
$meta_description = "<meta name='description' content='defaults' />";
$meta_keywords = "<meta name='keywords' content='defaults' />";
$meta_target = "<meta name='target' content='defaults'/>";
$meta_classification = "<meta name='classification' content='defaults'/>";
$script_name = "";
try {
$splits = explode("/", $_SERVER["SCRIPT_NAME"]);
$script_name = $splits[count($splits) - 1];
def initialize(context):
# we are going to use some high volatility tech stocks.
context.stocks = [sid(24), sid(1900), sid(5061), sid(3766), sid(13940), sid(20198), sid(27533), sid(40562)]
#context.stocks = [sid(3), sid(2), sid(1)];
log.info( context.stocks )
#context.stocks = (sid(5729), sid(1637), sid(27558), sid(2190), sid(35920), sid(32146), sid(35902))
context.bought = False
context.max_notional = 1000000.1
@a-r-d
a-r-d / task_quick_sort.as
Last active December 11, 2015 07:49
AS3- using quick sort algorithm to sort on an arbitrarily specified attribute of a typed vector.
/**
* Some constants we use to choose sorting methods.
*/
public static const SORT_BY_DATE_START:String = "DATE_START";
public static const SORT_BY_ID_ASC:String = "ID_ASC";
/**
* Example function that calls the quick sort on a vector of some beans
*/
@a-r-d
a-r-d / form.html
Created January 24, 2013 20:26
Simple PHP contact form. Been re-using a lot so might as well have it sitting somewhere, JS could maybe
<h3>
Drop us a line:
</h3>
<br />
<table class="tableForm">
<tr>
<td class="label">Your Email:</td>
<td class="component">
<input type="text" id="input01" class="component-input" />
@a-r-d
a-r-d / get_trending.sql
Last active December 11, 2015 16:59
So this halves the time over the commented out (used to be ~1 second) but it still takes a full half a second on fully indexed 100,000 rows.