Skip to content

Instantly share code, notes, and snippets.

View druid628's full-sized avatar

Micah Breedlove druid628

View GitHub Profile
@druid628
druid628 / urlShortCode.php
Created December 2, 2011 16:42
phpUrlShortenMethod
<?PHP
$url = "http://blog.code-grove.net";
echo urlShorten($url);
exit();
function urlShorten($url, $times2Split = 6)
{
$encoded2 = generateHashes($url);
// for testing purposes we're only using the $encoded['md5']
@druid628
druid628 / busyScript.groovy
Created November 9, 2011 21:01
Inspired by epochBlue's lookBusy Script. Installing grails plugins sure do take a long time :D
#!/usr/bin/groovy
import java.util.Random
def scriptDir = new File(getClass().protectionDomain.codeSource.location.path).parent;
def pluginsList = ["spring-security-core", "dojo", "hibernate", "tomcat", "searchable", "spring-social-core", "uploadr"];
def grailsHeading = "Using Java at: /usr/lib/jvm/java-6-openjdk\n" +
"Welcome to Grails 1.3.7 - http://grails.org/\nLicensed under Apache Standard License 2.0\n" +
"Grails home is set to: /usr/share/grails/1.3.7\nBase Directory: ${scriptDir}\nResolving dependencies...\n" +
"Dependencies resolved in 888ms.\nRunning script /usr/share/grails/1.3.7/scripts/InstallPlugin.groovy\n" +
@druid628
druid628 / RemoveDOSlineEndings.sh
Last active October 30, 2019 18:39
Perl 1-Liner to remove dos line endings from a file (all the while backing it up)
#NOTE: ^M -- To get the ^M you must use <CTRL+V><CTRL+M>
#
# $ perl -p -i.bak -e "s/^M//g" <FILENAME>
#
#Creates a <FILENAME>.bak file and removes the DOS line ending (^M)
perl -p -i.bak -e "s/^M//g" <FILENAME>