Skip to content

Instantly share code, notes, and snippets.

View akiletour's full-sized avatar
💛
Available

Pascal GAULT akiletour

💛
Available
View GitHub Profile
@akiletour
akiletour / spacing.scss
Created November 3, 2021 09:20
Custom mixins to manage margin and padding
$space-properties: (
"mt": "margin-top",
"mb": "margin-bottom",
"ml": "margin-left",
"mr": "margin-right",
"pt": "padding-top",
"pb": "padding-bottom",
"pl": "padding-left",
"pr": "padding-right",
"my": "margin",
@akiletour
akiletour / README.md
Last active March 4, 2021 11:58
Roots // Sage - Dedicated CSS per page (without JS)

Add a dedicated CSS per page on Roots / Sage

If we add an dedicated CSS for one page on WordPress. Browsersync (yarn watch) doesn't catch changes.

It's due to browsersync and sage who are looking for a JS file associated with this CSS.

THE TRICKS

The trick is to emulate JS files on the fly when BrowserSync catch the link's tag

<?php
class Product extends ProductCore
{
public $composition;
public $monsecondchamp;
public function __construct(
$id_product = null,
$full = false,
$id_lang = null,
@akiletour
akiletour / setup.php
Last active January 20, 2020 09:43
Roots Sage // Create route for development env
<?php
// [...]
if (getenv('WP_ENV') === 'development') {
add_action(
'init',
function () {
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH), '/');
if ($url_path === 'ui') {
@akiletour
akiletour / create-admin.php
Created October 10, 2018 10:26
Allows us to generate administrator on Prestashop 1.6
<?php
// PRESTASHOP 1.6 - Generate administrator
// php create-admin.php EMAIL PASSWORD
// This file must be placed in the root directory of the project
// Delete it after
$firstname = 'Support';
$lastname = 'Dutiko';
$email = trim($argv[1]);
$pwdClear = trim($argv[2]);
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@akiletour
akiletour / Brewfile
Last active July 21, 2017 07:42
Brewfile for Development Workstation
tap 'caskroom/cask'
brew 'git'
brew 'npm'
cask 'sequel-pro'
cask 'tower'
cask 'focus'
cask 'iterm2'
cask 'adobe-creative-cloud'
#!/bin/bash
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
#!/bin/bash
CONTAINER=$1
if [ -z "$1" ]
then
echo "ERROR: Container name missing"
exit
fi
@akiletour
akiletour / git-new-origin
Created April 12, 2016 14:49
Moving git repository to a new server
#!/bin/bash
git clone --mirror <url_of_old_repo>
cd <name_of_old_repo>
git fetch
git remote add new-origin <url_of_new_repo>
git push new-origin --mirror
git remote rm origin
git remote rename new-origin origin