Skip to content

Instantly share code, notes, and snippets.

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

Romans Malinovskis romaninsh

🚴‍♂️
Focusing
View GitHub Profile
@romaninsh
romaninsh / swapon.service
Created December 1, 2014 10:05
Set up swap on CoreOS
create this file in your /root folder
$ fleetctl load swapon.service
$ fleetctl start swapon.service
This will create swap file on all nodes of your CoreOS cluster without prior setup.
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted
@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: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();
grant all on `exdash`.* to 'exdash'@'localhost' identified by '*********';
<?php
class Form_Register extends Form {
function init(){
parent::init();
$this->addField('Line','email')->validateNotNull();
$this->addField('Password','password')->validateNotNull();
$this->addSubmit('Register');
node test2.js
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIISSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWWWWWWWWWWWWWWWWWWTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNBBBBBBBBBBBBOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCCCCCCCCCCCCUUUUUUUUUUUUUUUUUUULLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRYYYYYYYYYYYYYYYGGGGGGGGGGGGGGGGDDDDDDDDDDDDDDDDDDDDDDFFFFFFFPPPPPPPPPPPPPPPPPPVVVXXKKKKKKKQJJ
I SAW THE MAN WITH THE BINOCULARS
THEY ARE HUNTING DOGS
FREE WHALES
POLICE HELP DOG BITE VICTIM
HE SAW THAT GAS CAN EXPLODE
TURN RIGHT HERE
WE SAW HER DUCK
IN ANIMAL CRACKERS GROUCHO MARX AS CAPTAIN RUFUS T SPAULDING QUIPPED ONE MORNING I SHOT AN ELEPHANT IN MY PAJAMAS HOW HE GOT IN MY PAJAMAS I DONT KNOW
SHIP SAILS TOMORROW
BOOK STAYS IN LONDON
hello world
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
select SQL_CALC_FOUND_ROWS
`al_mo`.`id`,`al_mo`.`name`,`al_mo`.`created_dts`,`al_mo`.`deleted`,`al_mo`.`description`,
`al_mo`.`category_id`,
(select `al_ca`.`name` from `category` `al_ca` where `al_ca`.`deleted` = "N" and `al_mo`.`category_id` = `al_ca`.`id` ) `category`,
`al_mo`.`votes_support`,`al_mo`.`votes_abstain`,`al_mo`.`votes_oppose`, `al_mo`.`votes`,`al_mo`.`comments`,`al_mo`.`arguments`,
`al_mo`.`flags`,`al_mo`.`user_id`,
(select `al_us`.`name` from `user` `al_us` where `al_us`.`deleted` = "N" and `al_mo`.`user_id` = `al_us`.`id` ) `user_name`,
`al_mo`.`last_comment_dts`, `al_mo`.`last_vote_dts`,`al_mo`.`last_flag_dts`,`al_mo`.`last_argument_dts`,`al_mo`.`url`,
al_mo`.`is_hc`,`al_mo`.`motion_category_id`,`al_mo`.`video_id`,`al_mo`.`video_link`,`al_mo`.`tags`,
`al_mo`.`image_id`,