Skip to content

Instantly share code, notes, and snippets.

View geeksunny's full-sized avatar

Justin Swanson geeksunny

View GitHub Profile
@geeksunny
geeksunny / gist:2818423
Created May 28, 2012 10:34
A folder-action script to automatically add new files to the iTunes library
global app_state
-- check if itunes is running
set app_state to false
tell application "System Events"
if (exists process "iTunes") then set app_state to true
end tell
-- Adding files to the iTunes library when they are added to the watched folder
on adding folder items to my_folder after receiving the_files
@geeksunny
geeksunny / string_tools.php
Created May 15, 2012 05:25
stringTools: an interface to quickly automate common string conversion tasks.
<?php
/**
* StringTools
* Justin Swanson
* www.github.com/geeksunny | www.faecbawks.com | www.h4xful.net
*
* An example of this script can be found at http://beta.h4xful.net/tools/string_tools.php
*/
if (isset($_POST['mode']))
{
@geeksunny
geeksunny / gist:2502609
Created April 26, 2012 20:02
A PHP function to determine if a given IP address lies within a given range.
<?php
function check_ip_range($target, $range_start, $range_end)
{
if (ip2long($target) >= ip2long($range_start) && ip2long($target) <= ip2long($range_end))
return true;
else
return false;
}