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
#!/bin/bash | |
# | |
# chkconfig: - 16 84 | |
# description: Start up transmission-daemon | |
# | |
# processname: transmission-daemon | |
# config: /etc/sysconfig/transmission | |
# source function library | |
. /etc/rc.d/init.d/functions |
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
my $r = $self->routes; | |
push @{$r->namespaces}, 'Atlas::Backup::Web::Controller'; | |
my $job = $r->route('/job')->to(controller => 'Backup::Job'); | |
$job->get('')->to(action => 'collection'); | |
for my $method (qw/get post put delete/) { | |
$job->$method('/:id')->to(action => "single_$method"); | |
} |
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
package App::Schema::ResultSet; | |
use strict; | |
use warnings; | |
use parent 'DBIx::Class::ResultSet'; | |
__PACKAGE__->mk_group_accessors(inherited => qw/ | |
stash | |
/); |
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
App::ControllerBase::REST | |
App::ControllerBase::REST::API | |
App::ControllerBase::REST::GUI | |
App::Controller::API::V1::Manufacturer (currently inherits from App::ControllerBase::REST::API) | |
App::Controller::GUI::Manufacturer (currently inherits from App::ControllerBase::REST::GUI) | |
But also needs to inherit from a common ::Manufacturer class that actually implements most of the | |
shared functionality for fetching records from store. Currently done via Traits, but this is undesirable | |
due to __PACKGE__->config needing to be shared as well, which cannot be added via Traits. |
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
sub fetch : Chained('base') PathPart('') CaptureArgs(1) { | |
my ($self, $c, $company_id) = @_; | |
## $company_id is undef AFTER ->go | |
} | |
sub edit : Chained('fetch') PathPart('edit') Args(0) { | |
my ($self, $c) = @_; | |
## ... |
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
SELECT `me`.`id`, `me`.`parent_id`, `me`.`created`, `me`.`updated`, `me`.`type`, `me`.`name`, `me`.`contact_id` | |
FROM ( | |
SELECT `me`.`id`, `me`.`parent_id`, `me`.`created`, `me`.`updated`, `me`.`type`, `me`.`name`, `me`.`contact_id` | |
FROM `companies` `me` | |
WHERE `id` IN ( ( | |
SELECT `me`.`company_id` | |
FROM `user_roles` `me` | |
WHERE `user_id` = 'ARRAY(0x7fbb6072f818)' | |
GROUP BY `company_id` | |
), ( |
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
select * | |
from products p | |
left join product_custom_fields pcf1 on p.id = pcf1.product_id and pcf1.custom_field_id = 1 | |
left join product_custom_fields pcf2 on p.id = pcf2.product_id and pcf2.custom_field_id = 3 |
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
package SW::Web::Form::Component::InlineHelp; | |
use warnings; | |
use strict; | |
use HTML::FormHandler::Moose::Role; | |
=head2 inline_help | |
Inline help for a field. |
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
<html> | |
<head> | |
<title>MODX Revolution - Home</title> | |
<base href="http://www.example.com/roman-modx-003/" /> | |
</head> | |
<body> | |
</body> | |
</html> |
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
var url = 'http://www.google.com'; | |
var prefix = 'CA'; | |
var totalScreenshots = 10; | |
var screenshotDelay = 10; // seconds | |
var i = 0; | |
function makeScreenshot(url, filename, callback) { | |
var page = new WebPage(); | |
page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0'; | |
page.open(url, function(status) { |