Skip to content

Instantly share code, notes, and snippets.

View Twoody's full-sized avatar

Tanner Lee Woody Twoody

View GitHub Profile
@Twoody
Twoody / avl_tree.py
Created October 28, 2018 20:03 — forked from girish3/avl_tree.py
AVL tree implementation in python
#import random, math
outputdebug = False
def debug(msg):
if outputdebug:
print (msg)
class Node():
def __init__(self, key):
@Twoody
Twoody / .bashrc
Last active July 6, 2021 03:06
The best of my bashrc's from over time
# Author: Tanner.L.Woody@gmail.com
# Date: 2019-03-29
#Import (i.e. `source`) all files in ~/bin/
#for f in ~/bin/*; do source $f --source-only; echo "imported ~/bin/$f"; done
### Most convenient aliases
alias c='clear && ls && echo -e "\n" && gs'
alias q='exit'
alias g='grep -ri ' ## `g f foo/`
@Twoody
Twoody / countingDuplicates.php
Created September 5, 2019 18:02
Code Wars counting duplicates challenge done in PHP
<?php
function duplicateCount($text) {
$ret = 0;
$a = [];
$t = str_split( strtolower( $text ) );
$l = count($t);
for($i=0; $i<$l; $i++){
$c = $t[$i];
if ( array_key_exists($c, $t) ){
if( $t[$c] === 1 )
deploy-live (){
# Author: Tanner.L.Woody@gmail.com
# Creation Date: 2019-10-12
# Purpose:
# Deploy code to production server;
# This is done within a shell script as we do not have the /build/
# dir git controlled and manually need to copy over files that are
# generated to their corresponding path;
# TODO:
# Check if dirs exist on server; Mkdir if dirs do not exist;
@Twoody
Twoody / .vimrc
Last active November 10, 2019 22:46
My vimrc as of 2019-09-17
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""__VUNDLE CONFIG__""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
@Twoody
Twoody / first-day-install.sh
Last active November 4, 2019 19:27
First day installation for a phabricator, docker, and all the important stuff 🤘
#!/bin/sh
#***************************************************************************#
#***************************************************************************#
# FIRST DAY INSTALLS #
#***************************************************************************#
#***************************************************************************#
pprint (){
printf "############ ############ ############ ############ ############ ############\n"
true
@Twoody
Twoody / .bash_profile
Last active November 1, 2019 23:46
My bashrc as of 2019-09-17
ad=/usr/local/bin/arcanist
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
export PATH="$PATH:$ad/bin/"
@Twoody
Twoody / 2019-11-01.vimrc
Created November 1, 2019 16:43
Recent vimrc that might or might not be different
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""__VUNDLE CONFIG__""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
@Twoody
Twoody / phoneService.js
Last active October 16, 2019 23:36
A phone scrubber for quick formatting
// Helper methods for dealing with phone numbers and phone related content (i.e. "tel:")
export default
{
/**
* Display a phone number as a given format
* @param {String, Int} pnum - A Phone number
* @param {Int} displayCase - The desired formmatting pattern
* @return {String} - If good phone number, properly displayed phone number; Else, empty string;
*/
@Twoody
Twoody / cron.sh
Last active September 17, 2019 23:21
Example of cron job calling php script to general output /tm/cronOut.txt
#* * * * * /path/to/executable param1 param2
# use /bin/sh to run commands, no matter what /etc/passwd says
SHELL=/bin/sh
# mail any output to `paul', no matter whose crontab this is
MAILTO=tannerleewoody
#Pacific Time (Oregon)
CRON_TZ=PDT
#Out file:
out=/tmp/cronOut.txt
bDir=/var/www/testdir/bash/scripts/