Skip to content

Instantly share code, notes, and snippets.

View danielpclark's full-sized avatar
✍️
Working from home on open source

Daniel P. Clark danielpclark

✍️
Working from home on open source
View GitHub Profile
@danielpclark
danielpclark / budgetrental.py
Created September 1, 2012 13:41
Calculate how much a budget truck rental will cost you.
#!/usr/bin/env python
#
#
#
# Budget Rental Calculator * * * * *
# `Originl` Author: Daniel P. Clark <webmaster@6ftdan.com>
# Written : May 6th, 2011
#
@danielpclark
danielpclark / cfo.py
Created September 1, 2012 13:48
Clock Figure Outer - for converting your time card to decimal number and back.
print "Clock Figure Outer (CFO) 1.0 - 6ft Dan(TM)"
print "Author: Daniel P. Clark"
print "Written: <= 2005"
print
def parse(vString):
global rval, end
if ":" in vString:
rval = int(vString[-2:])*100/60
end = "hundredths"
@danielpclark
danielpclark / count.py
Created September 1, 2012 13:50
Recursive file counting.
#!/usr/bin/env python
# App Name: count
# Version: 0.2
#
# Author: Daniel P. Clark
# Date of creation: 05-09-2002
# Ladt modified: 12-21-2004
#
# E-mail: webmaster@6ftdan.com
@danielpclark
danielpclark / discount.py
Created September 1, 2012 14:05
Discount Wiz - first program I ever wrote.
# This is the first program I ever wrote.
# I never expected anyone to support me for writing it. ... But hey I tried.
#------------------------------DISCOUNT WIZ---------------------------
def op(): # ask for and set original price
original_price_str = raw_input("What is the price? $ ")
if original_price_str in ("", "exit", "close", "quit", "EXIT", "CLOSE", "QUIT"):
return "close"
@danielpclark
danielpclark / amencrypt.py
Created September 1, 2012 14:11
Some amateur encryption software I wrote some time before 2005
#!/usr/bin/python
#amencrypt.py
# Author: Daniel P. Clark
# Some amateur encryption software I wrote some time before 2005
import sys, string, time
@danielpclark
danielpclark / gmr.py
Created September 1, 2012 14:14
GRips MP3 Renamer - Take the default naming structure from grip and rename mp3s to Artist - Song.mp3
#!/usr/bin/env python
"""
Grips MP3 Renamer (GMR)
Author: Daniel P. Clark.
2-11-2002
STABLE 0.0.1
@danielpclark
danielpclark / mp3host.py
Created September 1, 2012 14:17
MP3 Host is a autogenerated mp3 hoster.
#!/usr/bin/env python
# -----------------------------------------------------
# MP3 Host is created by Daniel P. Clark of 6ft Dan(TM)
# Version 0.1 Stable 02/27/2011
# email: webmaster@6ftdan.com
#
# Purpose: This web applications generates a web page on the fly with media
# content to share. Thus allowing you to place new files in subfolders and
@danielpclark
danielpclark / imgnamer.py
Created September 1, 2012 14:21
This is 'supposed' to find all images without extension in the current directory and put the appropriate extension on them.
#!/usr/bin/env python
import os, imghdr
dlist = os.listdir("."+os.sep)
for x in dlist:
endr = imghdr.what(x)
endr = str(endr)
if endr == "None": continue
elif x[(len(endr)*(-1)):] == endr: continue
else: os.rename(x,x+"."+endr)
@danielpclark
danielpclark / resize.rb
Created September 1, 2012 20:56
Resize all images in a directory into a subfolder
#!/usr/bin/ruby
# resize usage:
# resize <folder> <image type> <scale>
# IE: resize ./ *.JPG 35
# Attribution:
# Original version of code was written by Joao Silva
# Available at http://codedefinition.com/batch-resize-image-with-ruby.html
@danielpclark
danielpclark / hddwarner.rb
Created September 2, 2012 03:25
Hard drive temperature warning system with emergency shutdown. Run as cron job and save your computer system from a fatal overheating.
#!/usr/bin/ruby
# HDD Warner
# Author: Daniel P. Clark
# webmaster@6ftdan.com
# License: MIT <http://opensource.org/licenses/mit-license.php>
# Date: August 31st, 2012
=begin
The MIT License (MIT)