Skip to content

Instantly share code, notes, and snippets.

View ksn135's full-sized avatar
🇷🇺

Serg N. Kalachev ksn135

🇷🇺
View GitHub Profile
@ksn135
ksn135 / gist:ea1271339e393911a533
Created December 13, 2014 13:25
Task SetFaclRightsTask class implementation for Magallanes
<?php
/*
* This file is part of the informational system package.
*
* (c) Serg N. Kalachev <serg@kalachev.ru>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Usage in your mage enviroment.yml:
@ksn135
ksn135 / ActionsController.php
Last active October 26, 2015 12:37
Symfony2Admingenerator Select2 ajax mode
<?php
namespace Ksn135\CompanyBundle\Controller\Employee;
use Admingenerated\Ksn135CompanyBundle\BaseEmployeeController\ActionsController as BaseActionsController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* ActionsController
*/
@ksn135
ksn135 / 1.html
Created July 22, 2015 04:28
JS includes in header
<script type="text/javascript" src="/app_dev.php/assetic/js/compiled/admingeneratorformextensions/jquery.min_jquery_1.js"></script>
<script type="text/javascript" src="/app_dev.php/assetic/js/compiled/admingeneratorformextensions/jquery-ui.min_jquery-ui_1.js"></script>
<script type="text/javascript" src="/app_dev.php/assetic/js/compiled/admingeneratorformextensions/momentjs.min_moment_1.js"></script>
<script type="text/javascript" src="/bundles/admingeneratorformextensions/vendor/moment/locale/ru.js?v1"></script>
@ksn135
ksn135 / config.yml
Created July 22, 2015 04:32
Part of config.yml
admingenerator_form_extensions:
image_manipulator: liip_imagine
upload_manager: vich_uploader
collection_upload:
async_listener_enabled: true
async_route_name: admingenerator_async_upload
file_storage: my.admingenerator.form.file_storage.local
include_jquery: true
include_jqueryui: true
include_momentjs: true
<?php
class Contract {
/* ... */
public function needRoundItUp()
{
<?php
/*
* This file is part of the XXXXXXXXXXXXXXXXXXXXXXXX informational system package.
*
* (c) Serg N. Kalachev <serg@kalachev.ru>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@ksn135
ksn135 / Action-generator.yml
Created August 3, 2015 04:46
s2a_collection_table example
# src/AppBundle/Resources/config/Action-generator.yml
generator: admingenerator.generator.doctrine
params:
model: AppBundle\Entity\Action
concurrency_lock: ~
bundle_name: AppBundle
pk_requirement: \d+
i18n_catalog: messages
embed_types:
- embed-Result-generator.yml

Keybase proof

I hereby claim:

  • I am ksn135 on github.
  • I am ksn135 (https://keybase.io/ksn135) on keybase.
  • I have a public key whose fingerprint is 5AC6 212A 5C5E B5D4 C4B5 EDB0 DC96 9657 7BEF 5523

To claim this, I am signing this object:

@ksn135
ksn135 / ksn135_unifi.sh
Created April 11, 2017 22:31
UNIFI Access Point shell interface, especially for glavkino.ru
#!/bin/bash
# UNIFI Access Point shell interface, v0.1
# (c) April 2017 by Serg N. Kalachev <serg@kalachev.ru>
username=it
password=Wifi555out
baseurl=https://172.16.144.35:8443
site=default
cookie=/tmp/unifi_cookie
response=/tmp/unifi_response
curl_cmd="curl -s -o ${response} -c ${cookie} -b ${cookie} --insecure"
@ksn135
ksn135 / SectionQuery.php
Last active May 18, 2017 21:14
Shop categories routing for Symfony 1.4 with Propel 1.2
<php
class SectionQuery extends BaseSectionQuery
{
private $categories = null;
public function filterVisible()
{
return $this->filterByIsVisible(true);
}