This file contains 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
// Add links to URLs, link usernames to Twitter timelines, hash tags to searches | |
// From: http://www.snipe.net/2009/09/php-twitter-clickable-links/ | |
function twitterify($ret) { | |
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("/@(\w+)/", "<a href=\"http://www.twitter.com/\\1\" target=\"_blank\">@\\1</a>", $ret); | |
$ret = preg_replace("/#(\w+)/", "<a href=\"http://search.twitter.com/search?q=\\1\" target=\"_blank\">#\\1</a>", $ret); | |
return $ret; | |
} |
This file contains 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
# skip already rewritten URIs, unless it's a request to use | |
# a non-detected page | |
RewriteCond %{REQUEST_URI} ^/(js|css|favicon.ico) | |
RewriteRule .* - [L] | |
RewriteCond %{QUERY_STRING} !device_class=(smart|feature|tablet|desktop) | |
RewriteCond %{REQUEST_URI} ^/(smart|feature|tablet|desktop) | |
RewriteRule .* - [L,E=DEVICE_CLASS:%1] |
This file contains 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/perl -wT | |
use strict; | |
use CGI; | |
use CGI::Carp; | |
use constant BUFFER_SIZE => 4_096; | |
use constant IMAGE_DIRECTORY => "/usr/local/apache/data/random-images"; | |
my $q = new CGI; |
This file contains 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/perl | |
# ./pwgen -c 64 | pbcopy | |
use Getopt::Std; | |
sub HELP_MESSAGE() { | |
my $fh = shift; | |
printf $fh <<END_HELP; | |
Usage: $0 \[-c\] \[-n\] \[-y\] \[length\] |
This file contains 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/perl | |
use File::Find; | |
use Getopt::Long; | |
use Pod::Usage; | |
use Term::ANSIColor; | |
use strict; | |
my $default_overhead_size = 2000; | |
my $default_page_size = 2500; |
This file contains 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
<pre> | |
<?php | |
$site_name = exec('whoami'); | |
echo "Starting Testing...\n"; | |
echo 'Running as ' . $site_name . "\n"; | |
echo 'Server that responded: ' . exec('uname -a') . "\n\n"; |
This file contains 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/perl | |
use Getopt::Std; | |
sub HELP_MESSAGE() { | |
my $fh = shift; | |
printf $fh <<END_HELP; | |
Usage: $0 \[-c\] \[-n\] \[-y\] \[length\] | |
Create a password length characters long; length defaults to 8 |
This file contains 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
$("table").addClass('table'); |
This file contains 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
git clone git@github.com:mistermarco/mistermarco.github.io.git | |
cd _posts | |
vi 2013-11-03-new-post.markdown | |
jekyll serve --watch |
OlderNewer