Skip to content

Instantly share code, notes, and snippets.

View toofff's full-sized avatar
🙃

Toofff toofff

🙃
View GitHub Profile
@soyuka
soyuka / OperationPathResolver.php
Created May 15, 2018 13:24
Workflow bridge for api platform
<?php
declare(strict_types=1);
namespace ApiPlatform\Workflow\PathResolver;
use ApiPlatform\Core\PathResolver\OperationPathResolverInterface;
final class OperationPathResolver implements OperationPathResolverInterface
{
@nginx-gists
nginx-gists / api_backends.conf
Last active April 21, 2024 09:19 — forked from lcrilly/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage

Doctrine Translatable

With Translatable you can translate the fields you like in your Doctrine Entity. Check out other Doctrine Extensions

  • Official Doctrine Extensions installation guide here.
  • Official Doctrine Translatable documentation over here.

Installation

composer.json

{* Structured Data Json - LD Microdata for Prestashop 1.6.X & 1.7
*
* Add this code in your smarty global.tpl/header.tpl file to show Organization, WebPage, Website and Product Microdata in ld+json format.
* Requires Prestashop 'productcomments' module for review stars ratings.
* by Ruben Divall @rubendivall http://www.rubendivall.com
* Module by @atomiksoft: https://addons.prestashop.com/en/seo-natural-search-engine-optimization/24511-microformats-in-ldjson.html
*}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
@Gregcop1
Gregcop1 / coffee-doco-event.sublime-snippet
Last active August 29, 2015 14:22
Snippet to chain parameters documentation
<snippet>
<content><![CDATA[# @event ${1:name} ${2:description}
#]]></content>
<tabTrigger><![CDATA[#e]]></tabTrigger>
<scope>source.coffee</scope>
</snippet>
@gergelypolonkai
gergelypolonkai / DynarrayConfiguration.php
Created April 27, 2015 08:22
Symfony 2 configuration: array of dynamic associative arrays
<?php
$rootNode
->children()
->arrayNode('state_machine')
->requiresAtLeastOneElement()
->beforeNormalization()
->ifArray()
->then(function($values) {
$ret = array();