Skip to content

Instantly share code, notes, and snippets.

@dgulino
dgulino / tgraph.py
Last active November 29, 2022 19:28
Console plotting in python. A single or multiple delimited numbers per newline.
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
#Copyright 2022 Drew Gulino
##This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
@dgulino
dgulino / pyliner.py
Created February 10, 2013 16:19
Python script that runs one-liner python scripts similarly to how Perl runs them portions based on http://code.activestate.com/recipes/437932-pyline-a-grep-like-sed-like-command-line-tool/ (Graham Fawcett, Jacob Oscarson, Mark Eichin) interface inspired by Perl
#!/usr/bin/env python
"""
Python script that runs one-liner python scripts similarly to how Perl runs them
portions based on http://code.activestate.com/recipes/437932-pyline-a-grep-like-sed-like-command-line-tool/
(Graham Fawcett, Jacob Oscarson, Mark Eichin)
interface inspired by Perl
"""
@dgulino
dgulino / ash.bash
Created January 25, 2013 23:08
I've come up with a much better, simpler recipe to color my OSX Terminal session depending on the host I'm ssh-ing into. First, take a function with some cool BASH-only splitting and arrays and add that I found a way to address the current session in Applescript. Then add a one line way to enable bash ssh auto-complete when using the function. E…
ash() {
ARGS="$@"
IFS=" "
set -- $ARGS
ARGSARRAY=( $@ )
HOST=${ARGSARRAY[0]}
IFS="-"
set -- ${HOST}
MYARRAY=( $@ )
SERVERTYPE=${MYARRAY[0]}