Skip to content

Instantly share code, notes, and snippets.

View joshtronic's full-sized avatar
🪦
Most forks are graves, not gardens

Josh Sherman joshtronic

🪦
Most forks are graves, not gardens
View GitHub Profile
#!/usr/bin/env python
# Uses one directory as the needle and another (or more) as the haystack
# to be able to determine file usage. The common use is to determine if
# you have any unreferenced images, css or JavaScript files. For example,
# use the images directory as the needle and your templates directory as
# the haystack to see how many times the images are referenced. If any
# have a count of zero, it's probably time to remove them.
#
# @author Josh Sherman
<?php
/**
* Smarty State Drop Down for PICKLES
*
* PICKLES is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
SELECT id
FROM table
WHERE "1981-02-23" IN (date1, date2, date3, date4, date5);
#!/usr/bin/env python
# Nonogram Demo
#
# This script generates a 10x10 pseudo-randomly generated Nonogram puzzle
# with hints. This is my first app in GTK since I dabbled with it when
# PHP-GTK was first released, and it's my first application in PyGTK since
# I started dabbling with Python not to long ago.
#
# If you're wondering what a Nanogram is, go here:
#!/usr/bin/env python
# Updates the genre and comment tags of MP3 files with data from
# allmusic.com. Specifically, the genre is populated with the fairly board
# genre listing and the comment tag is populated with the more specific
# styles for a particular album.
#
# Furthermore, I don't have permission from allmusic.com to do this, so if
# they come after you for using it, please respect their wishes.
#
#!/bin/bash
# Copies files inside nested directories to a single directory. Script does
# not do any checking for existing files, consider yourself warned.
#
# @author Josh Sherman
# @link http://joshtronic.com
if [ -z "$1" ]; then
echo "Usage: flatten-dir.sh /path/to/nested/directories [ /path/to/target/directory ]"
#!/bin/bash
# Simulates the Linux grep with the recursive flag -R Originally built to
# keep my sanity on older Sun Solaris installs.
#
# @author Josh Sherman
# @link http://joshtronic.com
if [ -z "$1" ]; then
echo "Usage: grepr.sh pattern path"
@joshtronic
joshtronic / .htaccess
Created January 26, 2012 23:14
my first dynamic website
RewriteRule ^(.+)$ index.php?request=$1 [NC,QSA]
<?php
class Object
{
public function __construct()
{
return $this;
}
public function piss()