Skip to content

Instantly share code, notes, and snippets.

Marin Bînzari SpartakusMd

Block or report user

Report or block SpartakusMd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@florentdestremau
florentdestremau / NewPasswordType.php
Last active Sep 12, 2019
A simple User authentication setup to copy & paste into your Symfony 3.4 install
View NewPasswordType.php
<?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;
@GrzegorzBandur
GrzegorzBandur / Readme.md
Last active Sep 13, 2019
RESTful API with Symfony 4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle
View Readme.md

RESTful API with Symfony 4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle

To start writing RestFull API in symfony we will need bundles:

"friendsofsymfony/oauth-server-bundle": "1.6",
"friendsofsymfony/rest-bundle": "^2.3",
"friendsofsymfony/user-bundle": "^2.1",
"jms/serializer-bundle": "^2.4",
"nelmio/api-doc-bundle": "^2.13",
"sensio/framework-extra-bundle": "^5.2",
"symfony/apache-pack": "^1.0",
@lsmith77
lsmith77 / DoctrineMigrationTest.php
Last active Feb 23, 2019
PHPUnit functional test to check if migrations inside a Symfony app
View DoctrineMigrationTest.php
<?php
namespace AppBundle\Tests;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\DBAL\Driver\PDOMysql\Driver as MySQLDriver;
class DoctrineMigrationTest extends WebTestCase
{
@jeroenvdgulik
jeroenvdgulik / Talklist.md
Last active Jun 18, 2019
My mostly incomplete list of memorable talks that should probably be required material
@dimasch
dimasch / redis-clear
Last active Sep 20, 2019
Clear a redis cache in Docker
View redis-clear
docker exec -it container-name redis-cli FLUSHALL
@tjamps
tjamps / README.md
Last active Sep 17, 2019
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
View README.md

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@addyosmani
addyosmani / README.md
Last active Oct 17, 2019 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger
View README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@Ocramius
Ocramius / User.php
Last active Oct 1, 2019
Doctrine 2 ManyToMany - the correct way
View User.php
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@jexchan
jexchan / multiple_ssh_setting.md
Created Apr 10, 2012
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
You can’t perform that action at this time.