This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/groovy | |
| /** | |
| * Del.icio.us RSS to HTML converter | |
| * command line groovy script execution 1 required argument | |
| * with 1 optional argument | |
| * | |
| * | |
| * syntax: | |
| * groovy delicious http://feeds.delicious.com/v2/rss/<user>?private=<key>\&count=<count> [ /path/to/output/file ] | |
| * groovy delicious http://feeds.delicious.com/v2/rss/<user>?count=<count> [ /path/to/output/file ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Gotcha! | |
| if [ $# -ne 1 ]; then | |
| echo "No directory using current." | |
| exit 0 | |
| fi | |
| if [ ! -d $1 ]; then | |
| echo "That is not a directory dumbass." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Shell need to knows: | |
| ${PWD##*/} # current directory name not path cheaper than basename $PWD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| # src/druid628/traittesting/MP3Player.php | |
| namespace druid628\traittesting; | |
| use druid628\traittesting\traits as TRAITS; | |
| class MP3Player | |
| { | |
| use TRAITS\Track | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?PHP | |
| $context = stream_context_create(array('http' => array('header' => 'Host: www.govtrack.us'))); | |
| $url = 'http://www.govtrack.us/api/v2/vote_voter?vote=113312'; | |
| $s649 = json_decode(file_get_contents($url, 0, $context), true); | |
| foreach ($s649['objects'] as $key => $object) { | |
| $name = $object['person']['name']; | |
| $vote = substr($object['option']['value'], 0, 1); | |
| echo "$name -- $vote\n"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/php | |
| <?php | |
| /** | |
| * .git/hooks/pre-commit | |
| * | |
| * This pre-commit hooks will check for PHP error (lint), and make sure the code | |
| * is PSR compliant. | |
| * | |
| * Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Based on http://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php#108466 | |
| //dependency to inject | |
| class dep {} | |
| class a { | |
| /** | |
| * @inject | |
| * @var dep |
OlderNewer