Skip to content

Instantly share code, notes, and snippets.

View jkschoen's full-sized avatar

Jacob Schoen jkschoen

  • Chalmette, Louisiana
View GitHub Profile

Colons can be used to align columns.

Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1

The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.

@jkschoen
jkschoen / CustomConverter.java
Created February 6, 2013 16:13
Abstract class to use write a custom converter for a class, but for only certain fields.
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@jkschoen
jkschoen / gist:3355609
Created August 15, 2012 03:46
Just a bad example...
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Test {
static Test cursor = loadCursor();
static Date date = new Date();
@jkschoen
jkschoen / Test.pl
Created August 8, 2012 01:10
This is an example Perl script that can be used to work with the Script Launcher module in Maraschino.
#!/bin/bash/perl
$IP=@ARGV[0];
$PORT=@ARGV[1];
$SCRIPT_ID=@ARGV[2];
$WEBROOT=@ARGV[3];
$SLEEP_SECS=15;
if ($WEBROOT eq '') {
@jkschoen
jkschoen / Test.sh
Created August 7, 2012 02:59
This is an example Bash script that can be used to work with the Script Launcher module in Maraschino.
#!/bin/bash
IP=$1
PORT=$2
SCRIPT_ID=$3
WEBROOT=$4
SLEEP_SECS=15
if [ -z "$WEBROOT" ]; then
@jkschoen
jkschoen / xbmc_delete_watched_tv.py
Created August 3, 2012 04:53
Script that will work with Script Launcher module in Maraschino to delete watched tv shows in xbmc.
import datetime, getopt, sys, urllib, urllib2
import base64, httplib, json, os, socket
HOSTS = [
{'host': '192.168.1.2', 'port': 8080, 'username': 'xbmc', 'password': ''},
{'host': '192.168.1.3', 'port': 8080, 'username': 'xbmc', 'password': ''}
]
#XBMC access media through the network, an handles the various networking
#protocols. I do not. The script assumes that the media is accessible
@jkschoen
jkschoen / Test.py
Created August 3, 2012 04:48
This is an example Python script that can be used to work with the Script Launcher module in Maraschino.
#you will need these
import datetime, getopt, sys, urllib, urllib2
#you can remove this one in your own script
import time
def main(argv):
try:
opts, args = getopt.getopt(argv, "ipsw:", ["ip=", "port=", "script_id=", "webroot="])
except getopt.GetoptError:
@jkschoen
jkschoen / smugup.sh
Created January 26, 2012 19:09 — forked from tedder/smugup.sh
smugmug uploader script, from the (dead site) braindump.dk.
#!/bin/sh
which curl > /dev/null
test $? -gt 0 && echo "Curl is not on the path" && exit 1
test -f ~/.smugup && source ~/.smugup
UA="smugup.sh/1.0 (recht@braindump.dk)"
APIKEY="yppE0KMFXm9YwpJHXrrKR5MAHoWZvVaH"