Skip to content

Instantly share code, notes, and snippets.

View alexander-torosh's full-sized avatar

Alexander Torosh alexander-torosh

View GitHub Profile
@alexander-torosh
alexander-torosh / gdpr-update-password.jsx
Created June 15, 2023 12:27
gdpr-update-password.jsx
import React from 'react'
import PropTypes from 'prop-types'
const {string, number} = PropTypes
const propTypes = {
redirect: string,
company: string.isRequired,
}
class GdprUpdatePassword extends React.Component {
@alexander-torosh
alexander-torosh / crontab -e
Created March 24, 2016 12:52
Demio backend crontab
DEMIO_PATH=/home/ubuntu/www/demio
* * * * * php $DEMIO_PATH/apps/workers/cli.php triggers-cron >/dev/null 2>&1
* * * * * sleep 1; php $DEMIO_PATH/apps/workers/cli.php email >/dev/null 2>&1
* * * * * sleep 21; php $DEMIO_PATH/apps/workers/cli.php email >/dev/null 2>&1
* * * * * sleep 41; php $DEMIO_PATH/apps/workers/cli.php email >/dev/null 2>&1
* * * * * sleep 10; php $DEMIO_PATH/apps/workers/cli.php event-series-type >/dev/null 2>&1
* * * * * sleep 12; php $DEMIO_PATH/apps/workers/cli.php infinite-series >/dev/null 2>&1
*/5 * * * * sleep 15; php $DEMIO_PATH/apps/workers/cli.php overdue-webinars >/dev/null 2>&1
*/5 * * * * sleep 20; php $DEMIO_PATH/apps/workers/cli.php early-finished-webinars >/dev/null 2>&1
@alexander-torosh
alexander-torosh / Bootstrap.php
Created November 19, 2015 12:27
Phalcon CacheManager Helper
<?php
// ...
$di->set('cacheManager', new CacheManager());
@alexander-torosh
alexander-torosh / QueryBuilderQuery.php
Last active December 14, 2016 05:11
Example of using Phalcon Query Builder and Columns method
<?php
$qb = $this->modelsManager->createBuilder()
->columns(['e.*', 'i.*'])
->addFrom('Backend\Models\Event', 'e')
->innerJoin('Backend\Models\Image', 'e.id = i.event_id', 'i')
->where('e.id = :id:', ['id' => $some_id]);
$entries = $qb->getQuery()->execute();
/**
* $.hoverDelayed()
*/
(function($) {
'use strict';
// Оригінал
var oldHover = $.fn.hover,
// Заміна
@alexander-torosh
alexander-torosh / AclPlugin.php
Last active August 29, 2015 14:13
phalcon acl
<?php
/**
* ExceptionPlugin
* @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua)
* @author Aleksandr Torosh <[email protected]>
*/
use Phalcon\Mvc\Dispatcher,
Phalcon\Mvc\User\Plugin,
Application\Acl\DefaultAcl;
@alexander-torosh
alexander-torosh / gist:7927611
Last active December 31, 2015 03:29
Phalcon ViewEngine Volt extended
namespace Application\Mvc\ViewEngine;
class Volt extends \Phalcon\Mvc\View\Engine\Volt
{
public function __construct($view, $dependencyInjector = null)
{
parent::__construct($view, $dependencyInjector);
}
@alexander-torosh
alexander-torosh / index.phtml
Created September 12, 2013 09:42
News knockout.js
<?php
/**
* @copyright Copyright (c) 2011 - 2012 Aleksandr Torosh (http://wezoom.com.ua)
* @author Aleksandr Torosh <[email protected]>
*/
$title = 'Керування новинами';
$this->tag->prependTitle($title);
@alexander-torosh
alexander-torosh / Event.js
Created September 11, 2013 06:18
Event from javascript.ru
Event = (function() {
var guid = 0
function fixEvent(event) {
event = event || window.event
if ( event.isFixed ) {
return event
}
@alexander-torosh
alexander-torosh / gist:5968873
Created July 10, 2013 18:33
Can't uncheck checkbox normaly
// My Entity
class News extends \Phalcon\Mvc\Model
{
public $pub; // boolean field, Checkbox in Form
public function getPub()
{
return $this->pub;