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 / includes.html
Created November 15, 2017 17:54
Agile UI header includes
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-serialize-object/2.5.0/jquery.serialize-object.min.js"></script>
<script src="https://cdn.rawgit.com/mdehoog/Semantic-UI-Calendar/0.0.8/dist/calendar.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/mdehoog/Semantic-UI-Calendar/0.0.8/dist/calendar.css"/>
<script src="https://cdn.rawgit.com/atk4/ui/1.3.0/public/atk4JS.min.js"></script>
<script src="https://cdn.rawgit.com/atk4/ui/1.3.0/public/agileui.js"></script>
class User extends \atk4\data\Model
{
    function init() {
        parent::init();

        $this->addField('name');
        $this->addField('email');
    }
}
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("jQuery"));
else if(typeof define === 'function' && define.amd)
define("atk4JS", ["jQuery"], factory);
else if(typeof exports === 'object')
exports["atk4JS"] = factory(require("jQuery"));
else
root["atk4JS"] = factory(root["jQuery"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@romaninsh
romaninsh / ui-app.php
Created January 16, 2017 15:40
A fully-featured web app in 30-lines with Agile UI.
<?php
$app = new \atk4\ui\App('Hello World');
$db = new \atk4\data\Persistence_SQL($dsn);
$app->initLayout('Fluid');
$app->menu->addItem(['Demo1', 'icon'=>'form'], ['demo'=>'form']);
$app->menu->addItem(['Demo2', 'icon'=>'crud'], ['demo'=>'crud']);
$this->layout->add('View', ['view box'])->set('Entire Web APP in 30 lines of code!');
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, {$tag1}, my name is {$tag2}
<?php
namespace smbo;
class Model_Report_Ledger2 extends UnionModel {
use \atk4\core\AppScopeTrait;
function init() {
parent::init();
$this->addInvoices();
$this->addPayments();
@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
<?php
namespace smbo\tests;
/**
* Tests usage of classes thorugh bridge
*/
class InvoiceTest extends TestCase
{
function testInvoiceCreation()
{