Skip to content

Instantly share code, notes, and snippets.

View romaninsh's full-sized avatar
🚴‍♂️
Focusing

Romans Malinovskis romaninsh

🚴‍♂️
Focusing
View GitHub Profile
<?php
class Model_File extends LF_Model {
public $table = 'file';
public $storage = null;
public $local_copy = null;
function init(){
<?php
class Controller_Storage_S3 extends Controller_Storage {
public $useSSL = true;
public $endpoint = 's3-eu-west-1.amazonaws.com';
function connect(){
return new S3(
$this->app->getConfig('amazon/s3/Access_Key_ID'),
$this->app->getConfig('amazon/s3/Secret_Access_Key'),
select `article`.`id`,`article`.`image_id`,(select concat('/', `_f`.`dirname`, '/', `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `article`.`image_id` = `filestore_file`.`id` ) `image`,(select concat('/', `_f`.`dirname`, '/', `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `article`.`image_id` = `filestore_file`.`id` ) `image_4`,`article`.`show_photo_in_article`,`article`.`title`,`article`.`description`,`article`.`text`,`article`.`url_hash`,`article`.`date`,`article`.`time`,`article`.`meta_keywords`,`article`.`meta_description`,`article`.`news_of_the_day`,`article`.`is_published`,`article`.`is_archived`,`artic
hello world
node test2.js
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIISSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWWWWWWWWWWWWWWWWWWTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNBBBBBBBBBBBBOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCCCCCCCCCCCCUUUUUUUUUUUUUUUUUUULLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRYYYYYYYYYYYYYYYGGGGGGGGGGGGGGGGDDDDDDDDDDDDDDDDDDDDDDFFFFFFFPPPPPPPPPPPPPPPPPPVVVXXKKKKKKKQJJ
<?php
class Form_Register extends Form {
function init(){
parent::init();
$this->addField('Line','email')->validateNotNull();
$this->addField('Password','password')->validateNotNull();
$this->addSubmit('Register');
grant all on `exdash`.* to 'exdash'@'localhost' identified by '*********';
@romaninsh
romaninsh / gist:9ebdfb032dadbdb15dca
Created July 10, 2014 12:48
ATK4.3 default form submission handler syntax
$form->onSubmit(function($f){
$errors=[];
if($f['name'] != 'Joe') $errors[] = $f->error('You must be Joe');
if($f['surname'] != 'Blogs') $errors[] = $f->error('You must be Blogs');
if($errors) return $errors;
$f->update();
@romaninsh
romaninsh / gist:f6d8511ee193ad9d7830
Created August 29, 2014 13:49
Implementation of a tabbed crud page.
<?php
class page_index extends Page {
public $title='Dashboard';
function init() {
parent::init();
$this->add('View_Box')
->setHTML('Welcome to your new Web App Project. Get started by opening '.
@romaninsh
romaninsh / gist:7835eef2c71c9ab4ee97
Created March 10, 2015 14:52
Password Strength Checker for Agile Toolkit 4.1
<?php
// Add into a field to perform password strength checking
class StrengthChecker extends HtmlElement {
public $default_text='use secure password';
function init(){
parent::init();
$this->set($this->default_text);
$this->addClass('password-checker');