Skip to content

Instantly share code, notes, and snippets.

View Davidmattei's full-sized avatar

David mattei Davidmattei

  • Sappico
  • Belgium
View GitHub Profile
@marcw
marcw / server.conf
Created January 22, 2018 18:17
Nginx configuration to serve a Symfony app under a subdirectory of a PHP application
# With this nginx configuration, you will be able to serve a Symfony app in a subdirectory
# of a wordpress (or any other PHP application).
server {
listen 80;
listen [::]:80;
server_name mysite.com;
root /var/www/wordpress;
index index.php app.php index.html;
@jtbonhomme
jtbonhomme / jira-behing-nginx-ssl
Created September 26, 2015 07:49 — forked from alertor/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@Benedikt1992
Benedikt1992 / setup.sh
Last active November 9, 2018 09:08 — forked from boo1ean/setup.sh
Setup apache-2.4.16 + php-5.6.11 on CentOS 6.7
#!/usr/bin/env bash
# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
wget http://mirror.softaculous.com/apache//httpd/httpd-2.4.16.tar.gz
tar -xvf httpd-2.4.16.tar.gz
@calebbrewer
calebbrewer / wkhtmltopdf-install.md
Last active April 20, 2023 23:28
How to Setup wkhtmltopdf on CentOS 7

How to Setup wkhtmltopdf on CentOS 7

Install Dependencies

yum install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo

Install wkhtmltopdf

@calebbrewer
calebbrewer / Stop SELinux from blocking apache external program execution.md
Last active October 10, 2019 09:29
Allow apache to execute an external program through SELinux.

Allow apache to execute an external program through SELinux

This is helpful when you don't want to disable SELinux but do want to allow apache to execute an external program. For example wkhtmltopdf. Run the following commands from the terminal. (This has been tested in CentOS 7.)

Allow Exicution

setsebool httpd_execmem on

Change a dirs security context if the program writes to a file

@OlivierParent
OlivierParent / Symfony - RESTful API.md
Last active December 6, 2017 13:38
Symfony - RESTful API.md

NMDAD III — Symfony — RESTful API

New Media Design & Development III - The Symfony Framework Academiejaar 2014-2015, Arteveldehogeschool ©2014 Olivier Parent


[TOC]

@floriankraft
floriankraft / JcrQueryLibrary.md
Last active May 3, 2024 05:50
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@nateevans
nateevans / MenuBuilder.php
Created April 3, 2014 16:56
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@samsamm777
samsamm777 / gist:7230159
Last active April 26, 2024 13:24
PHP set private property value using reflection. This allows you to set a private property value from outside the object, great for PHPUnit testing.
<?php
$a = new A();
$reflection = new \ReflectionClass($a);
$property = $reflection->getProperty('privateProperty');
$property->setAccessible(true);
$property->setValue($a, 'new-value');
echo $a->getPrivateProperty();
//outputs: