Skip to content

Instantly share code, notes, and snippets.

View jshirley's full-sized avatar

Jay Shirley jshirley

View GitHub Profile
package MyApp::Model::DataManager;
use Moose;
use Data::Manager;
use Scalar::Util 'blessed';
use Email::Valid;
use Data::Verifier;
package MyApp::Model::DataManager;
use Moose;
extends 'Data::Manager';
sub new_from_schema {
my ( $class, $schema, @classes ) = @_;
my $verifiers = $class->_default_verifiers;
@jshirley
jshirley / gist:2406858
Created April 17, 2012 15:34 — forked from sartak/gist:2406822
PopupCalendarGroup syntax
var jobCalendars = new Y.PopupCalendarGroup({
container: Y.one('.job-form'),
start: '.form_job_date_start',
end: '.form_job_end_date'
});
var positionCalendars = new Y.PopupCalendarGroup({
container: Y.one('.position-form'),
start: '.form_job_date_start',
end: '.form_job_end_date'
@jshirley
jshirley / Guide.pm
Created April 8, 2012 14:53
Template Toolkit Macros for working with Catalyst::View::TT and Twitter's Bootstrap
# This is just to illustrate how to have a Guide action in your Catalyst application.
package MyApp::Controller::Guide;
use Moose;
BEGIN { extends 'Catalyst::Controller'; }
sub index : Path {
my ( $self, $c ) = @_;
#!/bin/bash
APP_HOME="$HOME/workarea/The-Daily-Practice"
SHA=`git log --pretty=format:'%h' -n 1`
EXPORT_DIR=$APP_HOME/root/static/build/$SHA
MINIFY="$APP_HOME/node_modules/uglify-js/bin/uglifyjs"
cd $APP_HOME
rm -rf $EXPORT_DIR
[%~ DEFAULT message_scope = 'global' ~%]
<div class="message">
[% FOREACH gpos IN messages.for_scope(message_scope).for_level('success').messages %]
<div class="gmessage" [% UNLESS gpos %]style="display: none"[% END %]><p>[% c.loc(gpos.id || gpos.text) %]</p></div>
[% END %]
[% FOREACH gerr IN messages.for_scope(message_scope).for_level('error').messages %]
<div class="rmessage" [% UNLESS gerr %]style="display: none"[% END %]><p>[% c.loc(gerr.id || gerr.text) %]</p></div>
[% END %]
[% FOREACH gwarn IN messages.for_scope(message_scope).for_level('warning').messages %]
<div class="omessage" [% UNLESS gwarn %]style="display: none"[% END %]><p>[% c.loc(gwarn.id || gwarn.text) %]</p></div>
traceroute to 190.221.164.227 (190.221.164.227), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 2.022 ms 0.983 ms 1.746 ms
2 ip70-180-184-1.lv.lv.cox.net (70.180.184.1) 9.783 ms 38.489 ms 26.404 ms
3 24-234-8-61.ptp.lvcm.net (24.234.8.61) 8.063 ms 8.579 ms 8.625 ms
4 24-234-6-185.ptp.lvcm.net (24.234.6.185) 21.028 ms 13.261 ms 20.690 ms
5 paltbprj01-ae0.0.rd.pt.cox.net (68.1.0.234) 60.729 ms 37.106 ms 34.085 ms
6 xe-0.paix.plalca01.us.bb.gin.ntt.net (198.32.176.14) 49.339 ms 38.373 ms 35.090 ms
7 ae-2.r06.plalca01.us.bb.gin.ntt.net (129.250.5.238) 122.536 ms 121.577 ms 121.425 ms
8 ae-1.r21.snjsca04.us.bb.gin.ntt.net (129.250.4.119) 50.129 ms 44.222 ms 38.609 ms
9 ae-5.r21.dllstx09.us.bb.gin.ntt.net (129.250.4.24) 67.728 ms 71.608 ms 93.383 ms
lwp-request -d -e -s -H 'Host: yui.yahooapis.com' http://190.221.164.226/3.5.0pr1/build/yui/yui-min.js
200 OK
Cache-Control: max-age=315360000
Connection: close
Connection: Transfer-Encoding
Date: Thu, 22 Mar 2012 17:18:38 GMT
Server: YTS/1.20.10
Content-Type: application/javascript
Expires: Sun, 20 Mar 2022 17:18:38 GMT
Last-Modified: Mon, 12 Dec 2011 20:50:55 GMT
Given a list of files and directories, recursively generate and minify like the following:
root/static/scripts/view/user.js -> build/$sha/scripts/view/user.js
build/$sha/scripts/view/user-min.js
groups : {
'template': {
// Only support -min, no debugging of compiled templates.
filter : 'min',
base : '/static/scripts/templates',
combine : true,
comboBase : '/combo?',
root : 'templates/',
patterns : {
'template-' : { },