Skip to content

Instantly share code, notes, and snippets.

View cawa87's full-sized avatar
🤡
bip bip

Aleksandr Zamiatin cawa87

🤡
bip bip
View GitHub Profile
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>
{{ app_name }} - {% block title %}{% endblock %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Latest compiled and minified CSS -->
<?php
namespace VswSystem\AdminBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use VswSystem\CmsBundle\Entity\TextContentPage as Page;
class TextPageEditType extends AbstractType
<?php
namespace VswSystem\CoreBundle\Controller\Listener;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use VswSystem\CmsBundle\Controller\PageController;
<?php
namespace VswSystem\CoreBundle\Menu;
use Doctrine\ORM\EntityManagerInterface;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\SecurityContextInterface;
@cawa87
cawa87 / gist:5beadba63b1528f9ef9b
Created December 13, 2014 15:53
Laravel Imagine Service
<?php
namespace App\Services\Image;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
/**
* Class ImageService
@cawa87
cawa87 / gist:485a4e46b4aecfdd4801
Created December 15, 2014 09:18
KnpPagination View with filters
{% extends "VswSystemAdminBundle::layout.html.twig" %}
{% block title %}
VswSystem - Donors
{% endblock %}
{% block content %}
{% from 'MopaBootstrapBundle::macros.html.twig' import label %}
<div class="page-header">
<h1>Donors
<small>
<hr>
@cawa87
cawa87 / form
Created December 24, 2014 10:26
Ajax
$('#asideRegisterForm').on('submit', function (e) {
$.ajax({
type: "POST",
url: $(this).attr('action'),
data: $(this).serialize()
}).done(function () {
$('#asideRegisterForm').hide('fast');
$('#asideRegister').show('fast');
});
return false;
@cawa87
cawa87 / iptables_flush.sh
Created January 11, 2015 14:29
Reset iptables firewall rules
#!/bin/sh
echo "Flushing iptables rules..."
sleep 1
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
@cawa87
cawa87 / laravel.conf
Last active August 29, 2015 14:14
Full Laravel nginx config
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@cawa87
cawa87 / microcache_host.nginxconf
Last active August 29, 2015 14:15
Nginx micro cache conf example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)