Skip to content

Instantly share code, notes, and snippets.

View AHartTN's full-sized avatar

Anthony Hart AHartTN

  • AH Operations
  • Hermitage, TN
View GitHub Profile
import intrinio
from datetime import datetime
from dateutil.relativedelta import relativedelta
from os.path import join
from mssql import MSSQL
from utility import Utility
class StockData(object):
"""This class was developed to make working with stock data easier"""
@AHartTN
AHartTN / GlyphWatchdog.bat
Created October 23, 2011 02:56
Lacuna Expanse Glyphinator Watchdog
@Echo off
E:
cd LE\GLC\examples
cls
echo Starting Glyphinator Watchdog
echo If you want to close this watchdog, close the glyphinator window and type Y depending on your language followed by Enter in this window.
@AHartTN
AHartTN / gist:1215893
Created September 14, 2011 05:03
PE's Star DB Script - Modded to clear pre-existing data beforehand
#!/usr/bin/perl
#
# This program manages the star database used by glyphinator
# It performs the following functions:
#
# * Fill star db from probe data
# * Merge a second db into the main one
use strict;
use warnings;
@AHartTN
AHartTN / gist:1116282
Created July 31, 2011 02:18
Traffic Classes
public static T JsonPost<T>(string url, string strJson)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.ContentType = "application/json; charset=utf-8";
request.Accept = "application/json, text/javascript, */*";
request.Method = "POST";
byte[] byteArray = Encoding.UTF8.GetBytes(strJson);
request.ContentLength = byteArray.Length;
using (Stream s = request.GetRequestStream())
@AHartTN
AHartTN / gist:1103570
Created July 25, 2011 04:43
JSON Create Empire IE: Create{object[] params)
{
"method":"create",
"params":[
"AHLibTest",
"sample",
"sample",
"d6656e5c-4b9f-4ecb-948f-ac95408c41e2",
"17",
"x32max@hotmail.com",
null,
@AHartTN
AHartTN / gist:1103549
Created July 25, 2011 04:15
Create Empire Parameters Object
// This gets converted into a json hash.
public class CreateEmpireParms
{
public string name;
public string password;
public string password1;
public string captcha_guid;
public string captcha_solution;
public string email;
public string facebook_uid;
@AHartTN
AHartTN / gist:1088495
Created July 18, 2011 03:34
Generic JSON HTTP POST method
public T JsonPost<T>(string url, string strJson)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.ContentType = "application/json; charset=utf-8";
request.Accept = "application/json, text/javascript, */*";
request.Method = "POST";
byte[] byteArray = Encoding.UTF8.GetBytes(strJson);
request.ContentLength = byteArray.Length;
@AHartTN
AHartTN / LE_Admin.cs
Created July 14, 2011 03:32
Lacuna Expanse
using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using System.Net;
using System.IO;
using System.Windows.Forms;
using System.Text;
using System.Collections;
using LELibrary.Logic;
using LELibrary.Objects;
@AHartTN
AHartTN / gist:1051581
Created June 28, 2011 16:55
ASP.NET Menu generated HTML CSS Classes and IDs
#NavigationRow
{
background-color: #3a4f63;
width: 100%;
}
#NavigationCell
{
width: 100%;
clear: both;
@AHartTN
AHartTN / gist:1051562
Created June 28, 2011 16:43
ASP.NET Menu generated HTML
<div class="clear hideSkiplink">
<a href="#NavigationMenu_SkipLink">
<img alt="Skip Navigation Links" src="somelonghashedthing" width="0" height="0" style="border-width: 0px;" /></a>
<div class="menu" id="Div1">
<ul class="level1">
<li><a title="The Home Page" class="level1 selected" href="/Default.aspx">Home</a>
</li>
<li><a>Administrator </a>
<ul class="level2">
<li><a title="Add, Edit, Delete, Update Customers" class="level2" href="/Secure/Administrator/CustomerMaint.aspx">