This file contains hidden or 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
form_for 'contact', +{ | |
url=>sub($self, $contact) { $contact->in_storage ? path('create') : path('update', [$contact]) } | |
}, sub ($self, $fb, $contact) { | |
form_for 'contact', +{ | |
create_url => sub($self, $contact) { path('create') }, | |
update_url => sub($self, $contact) { path('update', [$contact]) }, | |
}, sub ($self, $fb, $contact) { |
This file contains hidden or 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 MyClass::Moose; | |
use Moose; | |
has 'attribute1' => (is => 'ro'); | |
has 'attribute2' => (is => 'ro'); | |
has 'attribute3' => (is => 'ro'); | |
MyClass::Moose->meta->make_immutable; | |
} |
This file contains hidden or 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
use Moose; | |
use MooseX::MethodAttributes; | |
use Example::Syntax; | |
class Example::Controller::Account :isa(Example::Controller) { | |
sub root :At('$path_end/...') Via('../protected') ($self, $c, $user) { | |
$c->action->next($user->account); | |
} |
This file contains hidden or 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
use warnings; | |
use strict; | |
use DBI; | |
use AI::Embedding; | |
my $dbh = DBI->connect( | |
'DBI:Pg:dbname=[DB]', | |
'[USER]', | |
'[PASSWORD', |
This file contains hidden or 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
-- Assuming you already have a database named 'my_database' | |
CREATE TABLE colors ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100), | |
color_vector VECTOR(3) | |
); | |
INSERT INTO colors (name, color_vector) VALUES | |
-- Primary colors |
This file contains hidden or 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 Camel::Controller::Dialog; | |
use Moose; | |
use MooseX::MethodAttributes; | |
use Camel::Syntax; | |
use Types::Standard qw/Int/; | |
extends 'Camel::Controller'; | |
sub root :Via('../private') At('dialog/...') ($self, $c, $user) { |
This file contains hidden or 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 Camel::PSGI; | |
use Camel::Syntax; | |
use Net::Async::HTTP::Server::PSGI; | |
use IO::Async::Loop; | |
use IO::Async::Process; | |
use Module::Runtime 'use_module'; | |
die "ALPACA_HOME environment variable not set" unless $ENV{ALPACA_HOME}; |
This file contains hidden or 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
[info] Application powered by Catalyst 5.90130 | |
main: seed = 1683661395 | |
llama_model_load: loading model from 'ggml-alpaca-7b-q4.bin' - please wait ... | |
llama_model_load: ggml ctx size = 6065.34 MB | |
llama_model_load: memory_size = 2048.00 MB, n_mem = 65536 | |
llama_model_load: loading model part 1/1 from 'ggml-alpaca-7b-q4.bin' | |
llama_model_load: .................................... done | |
llama_model_load: model size = 4017.27 MB / num tensors = 291 | |
system_info: n_threads = 4 / 16 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | VSX = 0 | |
This file contains hidden or 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 COUNT( * ) FROM ( | |
SELECT | |
id, | |
person_id as author_id, | |
? as reader_id, | |
title, | |
content, | |
created_at | |
FROM posts | |
) "me": '333' |
This file contains hidden or 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 Example::Model::RegistrationInterfaceModel; | |
use Valiant::IM::Form; | |
field user_name => type=>'InputGroup', %opts; | |
field first_name => type=>'InputGroup', %opts; | |
field last_name => type=>'InputGroup', %opts; | |
1; |