Skip to content

Instantly share code, notes, and snippets.

View MikSDigital's full-sized avatar
🎯
Focusing

Mikhail MikSDigital

🎯
Focusing
View GitHub Profile
@florentdestremau
florentdestremau / NewPasswordType.php
Last active August 1, 2024 15:14
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@dmesquita
dmesquita / data.json
Last active January 30, 2022 19:33
d3 co-occurence matrix
{"nodes": [{"group": "humanas", "index": 0, "name": "ADMINISTRAÇÃO"},
{"group": "humanas", "index": 1, "name": "ANTROPOLOGIA"},
{"group": "humanas", "index": 2, "name": "ARQUEOLOGIA"},
{"group": "biologicas", "index": 3, "name": "BIOLOGIA ANIMAL"},
{"group": "saude", "index": 4, "name": "BIOLOGIA APLICADA À SAÚDE"},
{"group": "biologicas", "index": 5, "name": "BIOLOGIA VEGETAL"},
{"group": "biologicas", "index": 6, "name": "BIOQUÍMICA E FISIOLOGIA"},
{"group": "exatas", "index": 7, "name": "BIOTECNOLOGIA INDUSTRIAL"},
{"group": "saude", "index": 8, "name": "CIRURGIA"},
{"group": "exatas", "index": 9, "name": "CIÊNCIA DA COMPUTAÇÃO"},
@lsv
lsv / README.md
Last active May 4, 2024 17:05
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
@lsv
lsv / Menu.php
Last active January 11, 2020 10:40
Symfony 4 - KnpMenuBundle - menu with event
<?php
// src/Menu/Menu.php
namespace App\Menu;
use App\Event\Menu\Topbar\UserMenuEvent;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RequestStack;
@Guibzs
Guibzs / .htaccess
Last active March 26, 2023 15:17
Symfony 4 ~ .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
<?php
define('SLACK_WEBHOOK', 'https://hooks.slack.com/services/xxx/yyy/zzz');
define('TELEGRAM_BOT_TOKEN', '...');
define('TELEGRAM_CHAT_ID', '12345');
function slack($txt) {
$msg = array('text' => $txt);
$c = curl_init(SLACK_WEBHOOK);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
@nicolasramy
nicolasramy / Dockerfile
Last active April 18, 2019 10:20
How to start a Vue.js + webpack dev stack (webpack is no mandatory ;))
FROM node:7.4-alpine
RUN mkdir /app
WORKDIR /app
ADD . /app/
RUN npm install
EXPOSE 8080
@yunusga
yunusga / yandex-jquery.html
Last active September 2, 2019 12:56
Подключение jQuery с CDN Яндекса
<script src="https://yastatic.net/jquery/3.1.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.1.0.min.js"><\/script>')</script>
@ylastapis
ylastapis / Configuration.php
Created May 23, 2016 09:23
AWS 3 with Symfony2 and Gaufrette
<?php
namespace AppBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
@chalasr
chalasr / LoginAuthenticationHandler.php
Last active January 11, 2020 11:23
FOSUserBundle Login Authentication Success Handler example.
<?php
namespace AppBundle\EventListener;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;