Skip to content

Instantly share code, notes, and snippets.

@tattali
tattali / GeoIP2 Symfony.md
Created January 29, 2023 16:37
Easy install of GeoIP2 with Symfony
View GeoIP2 Symfony.md
@tattali
tattali / Api Platform + GraphQL + Apollo + TypeScript.md
Last active January 2, 2022 16:43
Api Platform + GraphQL + Apollo + TypeScript
View Api Platform + GraphQL + Apollo + TypeScript.md

Api Platform + GraphQL + Apollo + TypeScript

Symfony | Api Platform | GraphQL | Apollo | TypeScript | React Hooks

Backend

Install Api Platform

composer req api
@tattali
tattali / Create or Get UTM Cookies with Symfony.md
Last active May 24, 2020 08:06
Create or Get UTM Cookies with Symfony
View Create or Get UTM Cookies with Symfony.md

Create or Get UTM Cookies with Symfony

The UtmCookieBundle allow you to save utm parameters from url into a cookie. It's also provide a bunch of tools to easily retrive all or each utm.

  • Work with any flex Symfony projects 3.4+ to 5.0+
  • PHP v7.1+

Installation

Download tattali/utm-cookie-bundle using composer

@tattali
tattali / react-context.md
Last active July 12, 2022 08:29
How to share data between components with react context
View react-context.md

React Context as a store

TYPESCRIPT | useState

Context configuration

// src/services/context/StoreContext.tsx
import React, { createContext, Dispatch, PropsWithChildren, SetStateAction, useState } from "react";

export interface IStore {
  props1: string;
@tattali
tattali / Use fullcalendar.js library in your Symfony project with doctrine.md
Last active August 5, 2023 10:53
Use fullcalendar.js library in your Symfony project with doctrine
View Use fullcalendar.js library in your Symfony project with doctrine.md

Use fullcalendar.js library in your Symfony 4 project with doctrine

FullCalendar.js is a JavaScript event calendar customizable and open source. You can display a full-size event calendar that also compatible with google calendar.

Installation

Download tattali/CalendarBundle using composer

$ composer require tattali/calendar-bundle
@tattali
tattali / bootstrap-4-nav-collapse.md
Last active June 13, 2018 10:01
Bootstrap 4 nav collapse
View bootstrap-4-nav-collapse.md

No theme

<ul id="accordionExample">
  <li data-toggle="collapse" data-target="#collapseOne">
    Lvl 1
    <ul id="collapseOne" class="collapse show" data-parent="#accordionExample">
      <li>Lvl 1.1</li>
      <li>Lvl 1.2</li>
    </ul>
  </li>
View sf4 crud best practices.md

Symfony 4 CRUD best practices

Step by step

Two shots CRUD packages installation

composer require --dev sec-checker profiler server
composer require annotations twig asset translator form doctrine validator
View sf4 install.md

Symfony 4

Framework download and install

Install Symfony 4 skeleton

composer create-project symfony/skeleton my-project && cd my-project

Use git to versionize your project

View Configurer un VPS OVH et mettre en production un projet Symfony 4.md

Mettre en production un projet Symfony 4 sur un VPS OVH

VPS OVH | Ubuntu 16.04.3 LTS | LAMP | SYMFONY 4

Pré-requis

  • Votre projet doit être versionné avec git et hébergé (Github, Bitbucket...).
  • Vous devez avoir acheté un VPS et un nom de domaine.
  • Vous devez également générer une clé SSH sur votre ordinateur. (explications ci-dessous)

Création et ajout de la clé SSH au profil OVH

View gist:c29c943d3177cfc7f3fb16ab297fa95a

Mac OS X

Icons trouble

sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder