Skip to content

Instantly share code, notes, and snippets.

View thomaswardiii's full-sized avatar

Thomas Ward III thomaswardiii

View GitHub Profile
@thomaswardiii
thomaswardiii / custom_config_parser.py
Created February 1, 2015 00:48
ConfigParser with defaults and dictionary return
# Custom ConfigParser class
# Perhaps the defaults should be passed into this class for the purposes of others using this, but is scrubbed code from something
# I'll be using for my own purposes, and I wanted config stuff self-contained, and I'm still new to this so meh :)
import ConfigParser
class CustomConfigParser(ConfigParser.ConfigParser):
def __init__(self):
ConfigParser.ConfigParser.__init__(self)
# Change as necessary for your needs. Define all potential keys and their defaults here
@thomaswardiii
thomaswardiii / bacon.pl
Last active January 1, 2016 11:29
Bacon ipsum API command line script. Help and ~/.bacon coming soon
#!/usr/bin/perl
use HTTP::Tiny;
use JSON;
use Getopt::Long;
use Config::Simple ('-lc');
use File::HomeDir;
my $BASE_URL = "http://baconipsum.com/api/?";
my $paras = 0;
@thomaswardiii
thomaswardiii / bacon.php
Last active December 25, 2015 22:09
Bacon ipsum API command line script. Now with ~/.bacon default
#!/usr/bin/php
<?php
/**
* Bacon ipsum PHP-CLI script
*
* Generates sentences or paragraphs from baconipsum.com
*
* @version 1.0.1
* @author Thomas Ward III <thomaswardiii@gmail.com>
*/