Skip to content

Instantly share code, notes, and snippets.

View jshirley's full-sized avatar

Jay Shirley jshirley

View GitHub Profile
@jshirley
jshirley / ci.pl
Created July 9, 2012 18:31
Automatically run tests when a file is modified
use Filesys::Notify::Simple;
use App::Prove;
use lib qw(lib);
my $tests = @ARGV;
my $watcher = Filesys::Notify::Simple->new([ './lib', './t/lib' ]);
my $prove = App::Prove->new;
@jshirley
jshirley / CurryQuinoa.md
Created June 26, 2012 01:16
Curry Quinoa Recipe

Curried Quinoa

This is one of my favorite foods. I was bored and thinking of recipes I'd like to try and thought this one up. It is delicious.

Ingredients

One Medium Onion 3 cloves garlic French Beans

views : {
GoalListView : {
type : NS.GoalListView,
requires : [ 'Person', 'CategoryList', 'GoalList', 'NoteList' ],
preserve : true
}
},
showGoalView : function(req, res, next) {
this.handleView('GoalListView', req, res, next);

Make sure you:

  1. Have configured Catalyst::Plugin::MessageStack to point to your Data::Manager model.

  2. Create a guide action, mine is very basic:

     'guide' => Data::Verifier->new(
         profile => {
             'name' => {
                 type     => Email,
    

required => 1,

@jshirley
jshirley / macros.tt
Created May 29, 2012 17:06
Bootstrap Form Macros. Use these in combination with Twitter Bootstrap CSS, Catalyst::Plugin::MessageStack and Data::Manager
[%~
# Some illustrious documentation to get you started:
#
# The macros defined are to generate markup to save people from copy and pasting
# markup. They copy and paste hashes instead, which should be safer (in theory)
#
# The macros for forms are:
# * text_field - A simple text field, pass in type to override input type
# * password_field - A password field, equivalent to
# text_field({ type => 'password', ... })
var YUI = require('yui').YUI,
Y = YUI();
Y.use('parallel');
require('./second');
@jshirley
jshirley / Error
Created May 20, 2012 14:49
Index Mapping
[2012-05-20 07:46:06,920][DEBUG][action.search.type ] [Zaladane] [kb-post][0], node[Z2lVjAo1TaeFK4xFJ7seMQ], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3227f076]
org.elasticsearch.search.SearchParseException: [kb-post][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"has_child":{"type":"kb-post-tag","query":{"text":{"tag":"question"}}}}}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performF
initializer : function() {
var client = this.get('client'), list;
this.list = list = new ClientList({ client : client });
// If this view has a different client, set the list client.
// Inside of your ClientList, you probably want a bit of code that says
// after the clientChange there, load myself... like:
// this.after('clientChange', this.load, this);
this.on('clientChange', function () { list.set('client', e.newVal); });
var NS = Y.namespace('Bootstrap');
NS.Tooltip = Y.Base.create("bootstrapTooltip", Y.Widget, [ Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain], {
eventIn : 'mouseover',
eventOut : 'mouseout',
tooltip : null,
template : '<div><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
BOUNDING_TEMPLATE : '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
[% MACRO form_block BLOCK %]
[% context.scope = 'guide' %]
[% text_field({ label => 'Your Name', name => 'name',
value => 'This is focused', placeholder => 'Placeholder Text',
required => 1 }) %]
[% text_field({ label => 'Prepended', name => 'prepended_name', prepend => '&larr;',
value => 'This is focused', placeholder => 'Placeholder Text',
required => 1,