Skip to content

Instantly share code, notes, and snippets.

View jshirley's full-sized avatar

Jay Shirley jshirley

View GitHub Profile
sub setup : Chained('/') PathPart('') CaptureArgs(0) {
my ( $self, $c ) = @_;
my $client = $c->model('Facebook');
my $app_user = $client->users->is_app_user;
$app_user = 0 if ref $app_user eq 'HASH';
if ( $app_user ) {
$c->stash->{is_app_user} = 1;
$c->stash->{fb_user} = $c->model('Facebook')->canvas->get_user($c->req);
}
#!/bin/sh
# Start a Plack daemon.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$HOME/perl5/bin
DAEMON="$HOME/perl5/bin/plackup"
NAME="AppName"
CWD=`pwd`
# Defaults
RUN="no"
package MyApp::View::TT;
use strict;
use parent 'Catalyst::View::TT';
use Scalar::Util qw(blessed);
use DateTime::Format::DateParse;
__PACKAGE__->config(
package BackOffice::Controller::Combo;
use parent 'Catalyst::Controller';
use Try::Tiny;
use MIME::Types;
__PACKAGE__->config(
'mime_types_obj' => MIME::Types->new( only_complete => 1 ),
'mime_types' => { },
package Foo;
use Moose;
has 'expensive_attribute' => (
is => 'rw',
isa => 'Str',
lazy_build => 1
);
package My::Base::REST;
use Moose;
BEGIN { extends 'Catalyst::Controller::REST'; }
use CGI::Expand qw/expand_hash/;
__PACKAGE__->config(
'default' => 'text/html',
--- XMLRPCServer.pm.bck 2009-11-25 16:18:36.000000000 -0800
+++ XMLRPCServer.pm 2009-11-25 17:03:38.000000000 -0800
@@ -814,7 +814,9 @@
# not yet supported: metaWeblog.getTemplate, metaWeblog.setTemplate
'mt.getCategoryList', 'mt.setPostCategories', 'mt.getPostCategories',
'mt.getTrackbackPings', 'mt.supportedTextFilters',
- 'mt.getRecentPostTitles', 'mt.publishPost', 'mt.getTagList' ];
+ 'mt.getRecentPostTitles', 'mt.publishPost', 'mt.getTagList',
+ 'mt.rebuildBlog'
+ ];
package Catalyst::TraitFor::Model::DBIC::Schema::MogileFS;
our $VERSION = '0.01';
use namespace::autoclean;
use Moose::Role;
use Carp::Clan '^Catalyst::Model::DBIC::Schema';
use MogileFS::Client;
with 'Catalyst::Component::InstancePerContext';
/*
* Cross browser placeholder support, simply structure inputs:
* <input type="text" placeholder="Your placeholder text">
* And, of course, style:
* input.placeholder { color: #ccc; }
*
* Clears on submit
* Will get confused if the user enters placeholder text at the value.
*/
YUI().use("node", function(Y) {
#!/usr/bin/env node
require("./yui-builder").build({
filter: 'debug',
gallery: 'gallery-2010.08.25-19-45',
version: '3.2.0',
require: [
'event-delegate',
'io',
'widget',