Skip to content

Instantly share code, notes, and snippets.

Avatar

Sadler Jerome G3ronim0

View GitHub Profile
@G3ronim0
G3ronim0 / mysql-docker.sh
Created May 26, 2018 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
View aude.php
<?php
/**
* Template part pour afficher les horaires des cinémas
*
* @link https://codex.wordpress.org/Template_Hierarchy
*/
defined( 'ABSPATH' ) or wp_die();
$type = get_field( 'type' );
@G3ronim0
G3ronim0 / functions.php
Created Apr 2, 2017 — forked from imath/functions.php
Add a custom support status to Buddy-bbPress Support topic.
View functions.php
<?php
/**
* Filter the available status to add a custom one
*
* Requires buddy-bbpress-support topic plugin
* bbPress 2.5+
* WordPress 4.0
*
* @param array $allstatus the available status
View AC default value
function my_acf_default_cat( $field ) {
if( isset( $_GET['cat'] ) && ! empty ( $_GET['cat'] ) ) {
$field['default_value'] = esc_attr( $_GET['cat'] );
}
return $field;
}
add_filter('acf/load_field/key=field_58a2165345a9e', 'my_acf_default_cat');
@G3ronim0
G3ronim0 / destinataire-conditionnel.json
Created Mar 14, 2017
Caldera Forms - destinataire conditionnel
View destinataire-conditionnel.json
{"_last_updated":"Tue, 14 Mar 2017 20:53:58 +0000","ID":"CF58c8565442824","cf_version":"1.5.0.6","name":"Destinaire conditionnel","scroll_top":0,"description":"\t\t\t\t\t\t\t","success":"Form has been successfully submitted. Thank you.\t\t\t","db_support":1,"pinned":0,"hide_form":1,"check_honey":1,"avatar_field":"","form_ajax":1,"custom_callback":"","layout_grid":{"fields":{"fld_6594946":"1:1","fld_453118":"1:2","fld_8539935":"1:2","fld_7213609":"1:2","fld_6561980":"2:1","fld_2410344":"2:1"},"structure":"6:6|12"},"fields":{"fld_6594946":{"ID":"fld_6594946","type":"radio","label":"Mes dates","slug":"mes_dates","conditions":{"type":""},"required":1,"caption":"","config":{"custom_class":"","inline":1,"auto_type":"","taxonomy":"category","post_type":"post","value_field":"name","orderby_tax":"count","orderby_post":"ID","order":"ASC","default":"","show_values":1,"option":{"opt1921855":{"value":"date1","label":"Date 1"},"opt1194856":{"value":"date2","label":"Date 2"},"opt1560618":{"value":"date3","label":"Date 3"}}}
@G3ronim0
G3ronim0 / wp-increase-timeout.php
Created Feb 9, 2016 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
View wp-increase-timeout.php
<?php
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}
@G3ronim0
G3ronim0 / Woocommerce - output product variations in tab
Created Jan 16, 2016 — forked from simonlk/Woocommerce - output product variations in tab
Output Woocommerce product variations as a table within a tab on the single product page
View Woocommerce - output product variations in tab
// Add to functions.php
/*===================================================
Created by sk from Renegade Empire with help
from these sources:
http://docs.woothemes.com/document/editing-product-data-tabs/
http://www.sean-barton.co.uk/2013/03/remove-woocommerce-20-reviews-tab/#.UYnWe7XfB6N
http://www.sean-barton.co.uk/2013/03/sb-add-woocommerce-tabs-wordpress-plugin/#.UYrYL7XfB6M
View gist:9f12ba2857c12b26fde3
// ==UserScript==
// @name Premium SO
// @namespace pso
// @include http://www.sudouest.fr/*
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js
// ==/UserScript==
window.setTimeout(
function(){