Skip to content

Instantly share code, notes, and snippets.

View moltar's full-sized avatar
📦
Building stuff.

Roman moltar

📦
Building stuff.
View GitHub Profile
@moltar
moltar / go.pl
Last active December 11, 2015 17:58
go go go
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) = @_;
## ...
@moltar
moltar / design.txt
Created January 28, 2013 23:18
help with class organization
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.
@moltar
moltar / ResultSet.pm
Last active December 12, 2015 00:28
dbic stash example
package App::Schema::ResultSet;
use strict;
use warnings;
use parent 'DBIx::Class::ResultSet';
__PACKAGE__->mk_group_accessors(inherited => qw/
stash
/);
@moltar
moltar / Web.pm
Created February 20, 2013 22:46
routing
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");
}
#!/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
@moltar
moltar / out.txt
Created March 27, 2013 21:21
carton exec issue
# WORKS
perl -Ilocal bin/daemons/gearman-worker.pl start -f
# DOES NOT WORK
carton exec "bin/daemons/gearman-worker.pl start -f"
dyld: lazy symbol binding failed: Symbol not found: _gearman_worker_create
Referenced from: local/lib/perl5/darwin-2level/auto/Gearman/XS/XS.bundle
Expected in: dynamic lookup
@moltar
moltar / file.pl
Created November 10, 2013 13:57
__FILE__
package A;
sub file {
__FILE__;
}
package B;
use base 'A';
@moltar
moltar / rc
Created December 26, 2013 19:01
Make cpanm cache tar balls locally. Put this line in your .bashrc or .zshrc file.
export PERL_CPANM_OPT="--cascade-search --save-dists=$HOME/.cpanm/cache --mirror=$HOME/.cpanm/cache --mirror=http://search.cpan.org/CPAN"
@moltar
moltar / -
Created September 20, 2014 13:58
Undefined symbols for architecture x86_64:
"cv::fastMalloc(unsigned long)", referenced from:
cv::Ptr<cv::flann::SearchParams>::Ptr(cv::flann::SearchParams*) in FindTheGhost-306b62.o
cv::Ptr<cv::flann::IndexParams>::Ptr(cv::flann::IndexParams*) in FindTheGhost-306b62.o
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
_main in FindTheGhost-306b62.o
"cv::drawMatches(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, std::__1::vector<cv::DMatch, std::__1::allocator<cv::DMatch> > const&, cv::Mat&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, std::__1::vector<char, std::__1::allocator<char> > const&, int)", referenced from:
_main in FindTheGhost-306b62.o
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
_main in FindTheGhost-306b62.o
@moltar
moltar / test2.html
Created October 17, 2015 22:42
test2
asdasd
new trhing
update gist
asdasd
new line