Skip to content

Instantly share code, notes, and snippets.

@phlyper
phlyper / symfony3-rest-api.md
Created October 7, 2021 14:12 — forked from diegonobre/symfony3-rest-api.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 :

@phlyper
phlyper / apache2_pihole.md
Created May 2, 2021 19:08 — forked from GAS85/apache2_pihole.md
Apache2 config for pihole with custom / non-admin link
@phlyper
phlyper / result_check.md
Created July 22, 2020 20:02 — forked from fedir/result_check.md
Install WKHTMLTOPDF / WKHTMLTOX on CentOS

Installation verification

Bad

$ wkhtmltopdf https://www.google.fr output.pdf
Loading pages (1/5)
Error: Failed loading page https://www.google.fr (sometimes it will work just to ignore this error with --ignore-load-errors)

Good

@phlyper
phlyper / wkhtmltopdf@Debian8.sh
Created July 22, 2020 20:00 — forked from fedir/wkhtmltopdf@Debian8.sh
Install wkhtmltopdf on Debian 8, 9
apt-get update
aptitude install xfonts-base xfonts-75dpi fontconfig xvfb
mkdir ~/src/wkhtmltopdf -p
cd ~/src/wkhtmltopdf
wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/local/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+rx /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/sbin/wkhtmltopdf
/usr/local/sbin/wkhtmltopdf https://www.google.fr output.pdf
<?php
# Disable Automatic Updates in WordPress
# wp-config.php
define('WP_AUTO_UPDATE_CORE', false);
# Disable Cron and Cron Timeout
define('DISABLE_WP_CRON', true);
define('WP_CRON_LOCK_TIMEOUT', 60);
@phlyper
phlyper / Sublime Text 3 Build 3103 License Key - CRACK
Created September 1, 2016 19:59
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
<VirtualHost *:80>
#this handles sitename.example.com
ServerName example.com
ServerAlias *.example.com
Options -Indexes FollowSymLinks
UseCanonicalName Off
VirtualDocumentRoot /opt/example/sites/%1/app/webroot