Skip to content

Instantly share code, notes, and snippets.

View feltnerm's full-sized avatar

Mark Feltner feltnerm

View GitHub Profile
@feltnerm
feltnerm / m2u2dir
Created April 19, 2011 05:37
Useful for Djs to not screw with their real mp3s -- versions for python 2.7 and 2.6
#!/usr/bin/env python
"""
m3u2dir.py
Copies the files found in a .m3u file
to either the current working dir or a dir
specified on the command line.
IDEAS:
automatically find .m3u in current working dir
@feltnerm
feltnerm / dotfileback
Created April 19, 2011 05:48
Backup dotfiles to github
#!/usr/bin/env python
"""
backup_dotfiles.py
Copies dotfiles over (.zshrc, .screenrc, etc.) to a backup dir
and syncs them with github.
"""
import argparse
@feltnerm
feltnerm / motivator
Created April 19, 2011 05:49
simple motivational quotes on your console.
#!/usr/bin/env python
# Every hour:
# 1. Open quotes or goals based on the one opened least frequently
# a. Return random line from file
# b. display file
import time
import random
def get_line(lines):
@feltnerm
feltnerm / the_fing_weather
Created April 19, 2011 05:51
Tell me the f*ckin weather!
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
'''
Created on Jul 16, 2010
@author: mark
'''
import sys, string, pprint
from datetime import datetime
from thefuckingweather import LocationError, get_weather, DEGREE_SYMBOL
@feltnerm
feltnerm / audinf
Created April 19, 2011 05:51
display simple tracklist info about a directory of mp3s
#!/usr/bin/env python
"""
audinf.py
Displays simple track info about a list of mp3s
"""
import sys
import os
from mutagen.easyid3 import EasyID3 as eid3
@feltnerm
feltnerm / csv2readability.py
Created April 11, 2012 04:15
CSV to Readability
#!/usr/bin/env python
""" Upload a CSV file (like what Instapaper exports *hint* *hint*)\
to Readability. """
import os.path
import csv
import readability
READABILITY_KEY = ''
@feltnerm
feltnerm / WebServer.java
Created October 10, 2012 17:25
Webserver for CS3830
import java.io.*;
import java.net.*;
import java.util.*;
/**
* Primitive HTTP Web Server
* @author Mark Feltner
*
*/
@feltnerm
feltnerm / Roman_Converter.rb
Created December 8, 2012 01:40
a simple Roman number calculator. It is to read a Roman number, an operator (+, -, /, or *), and a second Roman number. It then shows the calculation using Arabic numbers and prints the result as a Roman number.
#!/usr/bin/env ruby
# AUTHOR: Mark Feltner
OPERANDS = {
"I" => 1,
"V" => 5,
"X" => 10,
"L" => 50,
"C" => 100,
@feltnerm
feltnerm / Roman_Converter.ada
Created December 8, 2012 01:40
a simple Roman number calculator. It is to read a Roman number, an operator (+, -, /, or *), and a second Roman number. It then shows the calculation using Arabic numbers and prints the result as a Roman number.
pragma License (Gpl);
-- ROMAN CONVERTER
-- This package provides two functions: one to convert an
-- integer to its Roman Numeral equivalent, and another to convert
-- a Roman Numeral (consisting of M,D,C,L,X,V,I) to its
-- integer equivalent.
---------------------------------------------------------------------
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package RomanConverter is
@feltnerm
feltnerm / dungeon.rb
Created December 8, 2012 01:43
Psuedo-Interactive Fiction Interpreter. Done via recursive descent.
#!/usr/local/bin/ruby
#
# dungeon.rb: dungeon state + operations to add/remove objs, open doors, etc.
# - Each object is represented as a simple string, and the intent is that
# each object would be in just one location.
#
# This file contains unit test code; to run it, type
# ruby dungeon.rb
# @author: Rob Hasker