Skip to content

Instantly share code, notes, and snippets.

Clément Biron posykrat

Block or report user

Report or block posykrat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@posykrat
posykrat / composer-ssl-error.md
Created Oct 24, 2018
Composer open ssl error
View composer-ssl-error.md

When using composer install or composer update i this error :

The "https://wpackagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
  error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
  Failed to enable crypto
  failed to open stream: operation failed

After many hours, i found this solution (on Windows 10, WAMP 3.1.4, Apache 2.4.27, PHP 7.1.9)

View keybase.md

Keybase proof

I hereby claim:

  • I am posykrat on github.
  • I am clementbiron (https://keybase.io/clementbiron) on keybase.
  • I have a public key ASApuMmlOrdpYkwfoWN41eL1v3ABR_JGudbApy1YroalEwo

To claim this, I am signing this object:

@posykrat
posykrat / functions.php
Created Nov 29, 2017
Woocommerce - Disable clear and wipe session data on logout
View functions.php
<?php
//Disable clear and wipe session data on logout
add_action( 'woocommerce_init', 'lovely_keep_sessions_on_logout' );
function lovely_keep_sessions_on_logout(){
remove_action( 'wp_logout', array( WC()->session, 'destroy_session' ) );
}
?>
@posykrat
posykrat / wp-config.php
Last active Jul 26, 2018
simple multiple env for WordPress
View wp-config.php
<?php
switch($_SERVER['HTTP_HOST'])
{
case 'localhost':
define('DB_NAME', '');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8mb4');
@posykrat
posykrat / getScrollDirection.js
Last active Oct 10, 2017
getScrollDirection
View getScrollDirection.js
this.getScrollDirection = function()
{
if (typeof this.lst == "undefined") this.lst = 0;
var st = (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0);
if (st > this.lst) {
this.lst = st;
d = 'down';
} else {
@posykrat
posykrat / woocommerce_email_recipient_cancelled_order.php
Last active Sep 15, 2017
woocommerce - pour ajouter le client au mail d'annulation
View woocommerce_email_recipient_cancelled_order.php
function cb_cancelled_order_add_customer_email( $recipient, $order ){
if($order != null){
return $recipient . ',' . $order->billing_email;
}else{
return $recipient;
}
}
add_filter( 'woocommerce_email_recipient_cancelled_order', 'cb_cancelled_order_add_customer_email', 10, 2 );
View tinymce_for_acf.php
//On ajoute une configuration Tinymce pour ACF
add_filter('acf/fields/wysiwyg/toolbars','dfwp_acfToolbars' );
function dfwp_acfToolbars($toolbars)
{
// Add a new toolbar called "Very Simple"
// - this toolbar has only 1 row of buttons
$toolbars['DFWP Tools' ] = array();
$toolbars['DFWP Tools' ][1] = array(
'bold',
'italic',
@posykrat
posykrat / gist:da96a7bcf88e52a2e783
Created Feb 7, 2016
installation de wp cli sur windows
View gist:da96a7bcf88e52a2e783
lire et faire https://www.ltconsulting.co.uk/automated-wordpress-installation-cmd/
et créer l'alias (pour cygwin)
alias wp='php C:/usr/local/bin/wp
View gist:9037fd361411b603d734
Octo Linker
Octotree
Save to Pocket
The QR Code Extension
uBlock Origin
LiveReload
Appspector
http://re-view.emmet.io/
View gist:ef6c864209e0b187a331
var plumber = require('gulp-plumber');
var gutil = require('gulp-util');
//Affichage des erreurs
var onError = function (err) {
gutil.beep(); // Marche pas
gutil.log(gutil.colors.red(err.message + ' in '+ err.filename)); //Pas de couleur
};
/**
You can’t perform that action at this time.