Skip to content

Instantly share code, notes, and snippets.

View amiss18's full-sized avatar

armel amiss18

View GitHub Profile
<?php
// https://stackoverflow.com/questions/53048413/display-a-custom-text-if-user-has-already-bought-the-current-product-in-woocomme
// Utility function to check if a customer has bought a product (Order with "completed" status only)
function customer_has_bought_product( $product_id, $user_id = 0 ) {
global $wpdb;
$customer_id = $user_id == 0 || $user_id == '' ? get_current_user_id() : $user_id;
$status = 'wc-completed';
@amiss18
amiss18 / google-drive-upload-pdf.php
Created July 6, 2021 14:09 — forked from hubgit/google-drive-upload-pdf.php
Upload a PDF file to Google Drive
<?php
require 'google-api/apiClient.php';
require 'google-api/contrib/apiOauth2Service.php';
require 'google-api/contrib/apiDriveService.php';
$pdfFile = 'test.pdf';
// API Console: https://code.google.com/apis/console/
// Create an API project ("web applications") and put the client id and client secret in config.ini.
@amiss18
amiss18 / gitconfig.ini
Created July 1, 2021 17:37 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = [email protected]
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@amiss18
amiss18 / Interview back-end developer
Created June 20, 2021 14:19 — forked from jpchateau/Interview back-end developer
Entretien développeur back : PHP / Symfony / MySQL
Cible : Développeur PHP / Symfony / MySQL
Niveau : Senior
Ce document propose des questions classiques, sans piège, à poser lorsque vous désirez valider un candidat pour un poste de développeur back.
J'utilise personnellement cette trame de questions, libre à vous de vous en inspirer, d'ajouter vos propres questions, et de déterminer lesquelles sont éliminatoires à vos yeux.
Veille technologique
Quelle est la version actuelle de PHP ?
> http://php.net/supported-versions.php
@amiss18
amiss18 / bootstrap-4-sass-mixins-cheat-sheet.scss
Created June 15, 2020 14:35 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12;
$grid-gutter-width: 30px;
@amiss18
amiss18 / FileUploader.php
Created January 17, 2020 18:46 — forked from acecconato/FileUploader.php
Symfony + EasyAdmin: File upload system
/**
Due to best practices, we need to create a new service which is used by the ImageListener.
Its role is to upload files and generate an unique filename.
NOTA:
The default $uploadPath is autowired by argument binding inside services.yaml
but in this case, we override it with the $path argument of the upload method.
*/
<?php
@amiss18
amiss18 / gist:194883d847fcea683eacf39e3f0ec679
Created September 28, 2019 19:44 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@amiss18
amiss18 / docker_wordpress.md
Created September 23, 2019 11:17 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@amiss18
amiss18 / docker-help.md
Created September 23, 2019 11:17 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@amiss18
amiss18 / README.md
Created February 13, 2019 22:45 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})