Skip to content

Instantly share code, notes, and snippets.

View matberry's full-sized avatar

Matthieu Berry matberry

View GitHub Profile
@matberry
matberry / semantic-commit-messages.md
Created January 18, 2022 10:51 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@matberry
matberry / cookiebot-frame.js
Last active June 15, 2022 17:02
cookiebot-frame.js
/**
* If a user does not allow cookies (Youtube : marketing, Calameo : marketing and statistics),
* displays a message before all blocked iframes (iframes.cookieconsent-optin-marketing)
*
* Cookiebot user preferences are stored in :
* bool Cookiebot.consent.preferences
* bool Cookiebot.consent.statistics
* bool Cookiebot.consent.marketing
*
* Can be changed with Cookiebot.submitCustomContent(preferences,statistics,marketing)
QueryID Endpoint
17875800862117404 posts for tags
17874545323001329 user following
17851374694183129 user followers
17888483320059182 user posts
17864450716183058 likes on posts
17852405266163336 comments on posts
17842794232208280 posts on feed
17847560125201451 feed profile suggestions
17863787143139595 post suggestions
// load all dependencies. gulp-* dependencies are
// all loaded at once by gulp-load-plugins
var gulp = require("gulp");
var del = require("del");
var plugins = require("gulp-load-plugins")();
var autoprefixer = require("autoprefixer");
var cssnano = require("cssnano");
var cssmqpacker = require("css-mqpacker");
var uncss = require("postcss-uncss");
var pngquant = require("imagemin-pngquant");
<?php
global $current_user;
if(in_array('administrator', $current_user->roles)) {
//...
}
@matberry
matberry / git-deployment.md
Created August 8, 2019 13:45 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

<?php
/**
* Define type of server
*
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
*/
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use
@matberry
matberry / local-config-awesome-wp-config-file.php
Created August 6, 2019 13:04 — forked from ashfame/local-config-awesome-wp-config-file.php
Local config file to hold db credentials and for defining keys & salts along with the use of awesome wp-config.php file
<?php
/**
* WordPress config file to use one directory above WordPress root, when awesome version of wp-config.php is in use.
*
* Awesome wp-config.php file - https://gist.github.com/1923821
*/
/* WordPress Local Environment DB credentials */
@matberry
matberry / .csscomb.json
Created July 31, 2017 08:31
My CSS comb config.
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": false,
"leading-zero": false,
"quotes": "single",
@matberry
matberry / npm-tips.md
Last active September 29, 2017 21:57
NPM packages maintenance - Some usefull commands

NPM tips - Some usefull commands

Update NPM

npm i -g npm[@latest|@x.y.z]

List globally installed npm packages and version

npm list -g --depth=0