Skip to content

Instantly share code, notes, and snippets.

@jdevalk
jdevalk / register-graph-piece.php
Created January 22, 2020 12:39
This is the code used to generate the Event Schema for YoastCon
<?php
/**
* Adds Schema pieces to our output.
*
* @param array $pieces Graph pieces to output.
* @param \WPSEO_Schema_Context $context Object with context variables.
*
* @return array $pieces Graph pieces to output.
*/

Mettre en production un projet Symfony 3.4 sur un VPS OVH

VPS OVH | Ubuntu 18.04 LTS | LAMP | SYMFONY 3.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

@tameroski
tameroski / entretien.md
Last active October 9, 2019 16:28 — forked from Neamar/entretien.md
Questions pour des candidats à un entretien d'embauche

Questions...

Ces questions permettent de vous situer vis à vis de la programmation et de l'informatique en général. Il est normal de ne pas tout connaître ;)

Écriture et lecture de code

Que fait la requête SQL suivante :

SELECT Marque, AVG(Prix)
FROM Produits
GROUP BY Marque

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

@vaibhavpandeyvpz
vaibhavpandeyvpz / ubuntu-16-vps-lamp.sh
Last active April 27, 2023 16:23
Install and setup LAMP stack + Composer on a clean Ubuntu 16.04 VPS
#!/usr/bin/env bash
APACHE_USER=wwwhost
VHOSTS_DOMAINS=(example.com second.example.com)
sudo ufw allow in "OpenSSH"
# Install Apache
sudo apt-get update
sudo apt-get install apache2
sudo nano /etc/apache2/apache2.conf # Add ServerName ... directive at bottom
@M165437
M165437 / db-connect-test.php
Last active May 26, 2023 05:34 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
@trey8611
trey8611 / data_feed.php
Last active January 18, 2019 19:47
#proxyscript
<?php
/*
################### READ ME #################################
You must create a proxy file that retrieves your import file from FTP and then returns it.
You will then call that file with the 'Download from URL' option in WP All Import.
This is an example of such a proxy file. This is provided in the hopes it is useful, but without any support.
###############################################################
Instructions:
* Copy the code below to a new php file in the root of your WP site
* Update the FTP server details
@jserrao
jserrao / custom-search-acf-wordpress.php
Last active May 11, 2023 20:28 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request. I updated this original script with better documentation and XSS / SQL injection support.
/*
##############################
########### Search ###########
##############################
Included are steps to help make this script easier for other to follow
All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10
I also updated this work to include XSS and SQL injection projection
[list_searcheable_acf list all the custom fields we want to include in our search query]
@return [array] [list of custom fields]
@senlin
senlin / language-independent-acf-theme-options-output.php
Last active March 13, 2024 16:00
How to get language independent ACF theme options on a WPML site
<?php
/**
* To get this to work, you need to tinker with the acf/settings/ filter and reset the default language
* so that the get_field() function returns the correct results even when not on the default language.
*
* You can add the filter before you call the get_field() function and then call it again with the current
* language to reset it again, so it will affect other pages.
*
* answer courtesy of James of ACF Support
*/
@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus