Skip to content

Instantly share code, notes, and snippets.

View helios-ag's full-sized avatar
🐈
On the internet nobody knows you're a cat

Al Ganiev helios-ag

🐈
On the internet nobody knows you're a cat
View GitHub Profile
@helios-ag
helios-ag / gist:2432884
Created April 21, 2012 00:39
Recursive walk
private function walk($menu)
{
foreach ($menu->getChildren() as $childNode) {
if($childNode->hasChildren())
{
$childNode->setAttribute('class','dir');
}
$this->walk($childNode);
}
@helios-ag
helios-ag / Capfile
Created May 7, 2012 10:46
Capifony fix to set file permissions on Ubuntu for [cache] and [logs] dirs
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
load Gem.find_files('symfony2.rb').last.to_s
# Change ACL on the app/logs and app/cache directories
after "deploy:finalize_update" do
run "setfacl -R -m u:www-data:rwx -m u:#{user}:rwx #{latest_release}/#{cache_path} #{latest_release}/#{log_path}"
run "setfacl -dR -m u:www-data:rwx -m u:#{user}:rwx #{latest_release}/#{cache_path} #{latest_release}/#{log_path}"
end
fm_elfinder:
locale: %locale%
editor: tinymce4 # other choices are tinymce or simple
compression: false
include_assets: true
showhidden: false
fullscreen: true
connector:
debug: false # defaults to false
roots: # at least one root must be defined
<?php
namespace FM\MenuBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Knp\Menu\NodeInterface;
use Knp\Menu\MenuItem as BaseMenuItem;
use Knp\Menu\ItemInterface;
use Symfony\Component\Validator\Constraints as Assert;
fm_elfinder:
locale: %locale%
editor: ckeditor # other choices are tinymce or simple
compression: false
include_assets: true
fullscreen: true
connector:
debug: true # defaults to false
roots: # at least one root must be defined <-- roots section
uploads:
@helios-ag
helios-ag / 0_reuse_code.js
Created July 23, 2014 02:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@helios-ag
helios-ag / config.yml
Created September 8, 2014 05:09
Monolog loggger configuration for Graylog2 (Symfony2)
services:
gelf.udp.transport:
class: Gelf\Transport\UdpTransport
gelf.publisher:
class: Gelf\Publisher
arguments: [@gelf.udp.transport]
monolog.gelf_handler:
class: Monolog\Handler\GelfHandler
arguments: [@gelf.publisher]
@helios-ag
helios-ag / config.yml
Created February 24, 2015 02:23
Custom emoticons
fm_bbcode:
filter_sets:
my_default_filter:
strict: false # if you want to parse attr values without quotes
locale: en
xhtml: false
filters: [ default, block, code, email, image, list, url ]
hooks: [emoticon]
emoticon:
resource: %kernel.root_dir%/config/emoticons.yml
@helios-ag
helios-ag / gist:2abd77f3d6e02d0ea8ab
Created June 9, 2015 04:51
Tinymce/Elfinder configuration
stfalcon_tinymce:
include_jquery: true
tinymce_jquery: true
selector: ".tinymce"
theme:
simple: ~
advanced:
plugins:
- "advlist autolink lists link image charmap print preview hr anchor pagebreak"
- "searchreplace wordcount visualblocks visualchars code fullscreen"
@helios-ag
helios-ag / ConfigurationReader.php
Created July 11, 2015 15:46
ConfigurationReader.php
<?php
namespace AppBundle\Service;
use FM\ElfinderBundle\Configuration\ElFinderConfigurationReader;
use FM\ElfinderBundle\Model\ElFinderConfigurationProviderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
class ConfigurationReader extends ElFinderConfigurationReader