Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Nolwennig's full-sized avatar
🐘
Focusing

Nolwennig Nolwennig

🐘
Focusing
View GitHub Profile
@zalexki
zalexki / docker-https.md
Last active October 23, 2020 10:06
Docker Apache2.4 HTTPS

Open port 443 on container, with a docker-compose file just add :

ports:
  - 443:443

Add virtualhost config :

Listen 443 https
  
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active March 20, 2024 20:16
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + 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 authenticationu
  • 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 3 framework. The following SF2 bundles are used :

@mklooss
mklooss / shopping.php
Last active June 7, 2017 21:23
Magento Google Shopping - Simple Script
<?php
if(php_sapi_name() != 'cli')
{
die('only via cli');
}
require 'app/Mage.php';
umask(0);
@sdball
sdball / sandi_metz_rules_for_developers.md
Created January 18, 2013 18:47
Rules for good development from Sandi Metz

Sandi Metz’ rules for developers

  1. Your class can be no longer than a hundred lines of code.
  2. Your methods can be no longer than five lines of code
  3. You can pass no more than four parameters and you can't just make it one big hash.
  4. In your controller, you can only instantiate one object, to do whatever it is that needs to be done.
  5. Your view can only know about one instance variable.
  6. Your Rails view should only send messages to that object i.e., no Demeter violations.[ "thunder dome principal". Translated: one model in, one model out! ]
  7. Rules are meant to be broken if by breaking them you produce better code. [ ...where "better code" is validated by explaining why you want to break the rule to someone else. ]
@evaisse
evaisse / remove_accents.function.php
Created August 18, 2009 07:43
php function to remove accent from the input string string. An example string like `ÀØėÿᾜὨζὅБю` * will be translated to `AOeyIOzoBY`
<?php # -*- coding: utf-8 -*-
// function remove_accents()
/**
* Unaccent the input string string. An example string like `ÀØėÿᾜὨζὅБю`
* will be translated to `AOeyIOzoBY`. More complete than :
* strtr( (string)$str,
* "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
* "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn" );
*