Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
@trepidity
trepidity / HullMovingAvg
Created February 7, 2021 00:08
Thinkorswim HullMovingAvg
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below
input price = close;
input length = 20;
input WithinBars = 1;
def hma = HullMovingAvg(price,length);
<?php
$delimiter=",";
$src_file = $argv[1];
$tmpl_file = $argv[2];
if (file_exists($src_file)) {
if (file_exists($tmpl_file)) {
$src_handle = fopen($src_file,"r");
$tmpl_handle = fopen($tmpl_file,"r");
@trepidity
trepidity / positions.py
Created July 19, 2020 02:21
Pull the current TD Positions for all accounts
# Import the client
from td.client import TDClient
import pprint
from datetime import datetime
from datetime import timedelta
pp = pprint.PrettyPrinter(indent=4)
# Create a new session, credentials path is optional.
TDSession = TDClient(
@trepidity
trepidity / setHostname.sh
Created May 27, 2020 21:52
set machine hostname (FOR NAM)
echo "Creating host entry..." | tee -a $LOG_OUTPUT
HOST_NAME=`hostname`
IP_ADDR=`ip addr | grep -Po '(?!(inet 127.\d.\d.1))(inet \K(\d{1,3}\.){3}\d{1,3})' | head -n 1`
HOST_PRESENT=`grep $HOST_NAME /etc/hosts`
if [ -z "$HOST_PRESENT" ]
then
echo -e "$IP_ADDR\t$HOST_NAME\t$HOST_NAME" >> /etc/hosts
fi
@trepidity
trepidity / JSONAuthentication.java
Created April 6, 2020 18:43
JSONAuthentication
package com.novacoast.nam.authentication;
import com.novell.nidp.NIDPConstants;
import com.novell.nidp.NIDPContext;
import com.novell.nidp.authentication.AuthnConstants;
import com.novell.nidp.authentication.local.LocalAuthenticationClass;
import com.novell.nidp.common.authority.PasswordExpiredException;
import com.novell.nidp.common.authority.PasswordExpiringException;
import com.novell.nidp.common.authority.UserAuthority;
import com.novell.nidp.logging.NIDPLog;
from __future__ import print_function
import logging
import boto3
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# print(response['Reservations'][0]['Instances'][0]['InstanceId'])
@trepidity
trepidity / nam-build-cli.py
Created February 11, 2020 17:34
A script to install NetIQ Access Manager
from __future__ import print_function
import boto3
import botocore
import os
import shutil
import tarfile
import subprocess
import sys
import argparse
import io
@trepidity
trepidity / .zshrc
Last active November 9, 2020 12:44
my zsh RC file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/jjennings/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
@trepidity
trepidity / _loadResourcesAsync.js
Created April 16, 2018 13:38
Parsing error: Unexpected token = (at line 1)
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free
@trepidity
trepidity / Example Card native-base
Created April 14, 2018 16:10
An example of a card with a list using native-base
<Container>
<Content>
<Card>
<CardItem cardBody>
<Image source={{uri: 'https://images.unsplash.com/photo-1445052520430-32c8ebc92fe3?crop=entropy&dpr=2&fit=crop&fm=jpg&h=825&ixjsv=2.1.0&ixlib=rb-0.3.5&q=50&w=1450'}} style={{height: 200, width: null, flex: 1}}/>
</CardItem>
<CardItem>
<Title>{user.firstName + " " + user.lastName}</Title>
</CardItem>
<CardItem>