Skip to content

Instantly share code, notes, and snippets.

@kimmel
kimmel / perltest.pl
Created June 18, 2011 11:16
A wrapper to run multiple common perlcritic code tests on a single source file. This is licensed under the "3-clause BSD license" to be as free as possible.
#!/usr/bin/perl
#-----------------------------------------------------------------------------#
# Copyright (c) 2011 Kirk Kimmel. All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
# 3. The name of the AUTHOR may not be used to endorse or promote products derived from this software without specific prior written permission.
@kimmel
kimmel / gist:1160144
Created August 21, 2011 04:55
Makefile.PL does not generate META.yml
use 5.8.2;
# Load the Module::Install bundled in ./inc/
use inc::Module::Install;
BEGIN { $ENV{NYTPROF} = 'start=no'; }
# Define metadata
name 'Task-Gtk2';
abstract '';
@kimmel
kimmel / gist:1215251
Created September 13, 2011 21:42
colodiff 1.0.9 parse config file. race condition/input kludge. If you turn banner or color_patches off in the first colordiffrc and then turn them back on in the 2nd file, the parser fails to set the variables to yes.
#!/usr/bin/perl
use warnings;
use strict;
my $show_banner = 1;
my $color_patch = 0;
# ANSI sequences for colours
my %colour;
@kimmel
kimmel / .perltidyrc
Created October 22, 2011 12:29
.perltidyrc Perl Best Practices
# PBP .perltidyrc file
# Uncomment #-st to fully emulate perltidy -pbp
-l=78 # Max line width is 78 cols
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
#-st # Output to STDOUT
-b # Write the file inline and create a .bak file
-se # Errors to STDERR
@kimmel
kimmel / gist:1306010
Created October 22, 2011 13:30
Shell::Command example
#!/usr/bin/perl
use warnings;
use strict;
use Shell::Command;
my $name = 'newfile.pl';
rm_rf '*.tar.gz';
touch $name;
@kimmel
kimmel / mech_test.pl
Created January 5, 2012 14:54
A simple script for testing the caching of a WWW::Mechanize module
#!/usr/bin/perl
use v5.10;
use warnings;
use strict;
use autodie;
use POSIX qw( strftime );
use CHI;
use WWW::Mechanize::Cached::GZip;
@kimmel
kimmel / gist:2779203
Created May 24, 2012 03:03
pm redesign <head> without IE support
<!doctype html>
<html lang="en-us" class="no-js">
<head>
<meta charset="utf-8" />
<title>
new PM design
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="css/columnal.css" type="text/css" media="screen" />
@kimmel
kimmel / gist:2779229
Created May 24, 2012 03:17
pm redesign with IE support added in
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>
@kimmel
kimmel / reset.css
Created June 10, 2012 03:21
eric meyer's css reset v2.0 | 20110126
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@kimmel
kimmel / gist:2922824
Created June 13, 2012 08:40
basic html5 page with a css framework
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">