Skip to content

Instantly share code, notes, and snippets.

View chibani's full-sized avatar

Loïc Gerbaud chibani

View GitHub Profile
@chibani
chibani / unbound.conf
Created March 18, 2013 14:58
Exemple de config pour unbound.conf
server:
#verbosity: 1
#definition des interfaces réseaux du serveur
interface: 127.0.0.1
interface: 192.168.0.20
#ouverture à tout le monde
access-control: 0.0.0.0/0 allow
chroot: ""
@chibani
chibani / gitolite.conf
Created February 23, 2012 11:03
gitolite example config file
@first_team first_dev second_dev
@second_team third_dev fourth_dev
@first_repo_group one_repo second_repo
@second_repo_group third_repo fourth_repo
repo @first_repo_group
RW = @first_team
R = @second_team
@chibani
chibani / mycustom-archive.php
Created January 11, 2012 16:04
WordPress : Load custom posts using their custom fields
//WordPress Query to load custom posts using their custom fields
$myquery = new WP_Query(array(
'post_type' => 'mycustom',
'posts_per_page' => 15,
'orderby' => 'meta_value',
'meta_key'=>'mycustom_date_start',
'order' => 'ASC',
'meta_query'=>array(
'relation'=>'AND',
array(
@chibani
chibani / custom_post_type_columns
Created January 11, 2012 14:26
WordPress : adding custom columns in the posts list while using a custom post type
//This filter will allow us to add new columns
add_filter("manage_edit-mycustom_columns", "edit_columns");
//This action will populate the new columns
add_action("manage_posts_custom_column", "custom_columns");
/**
* First step : declaring the new columns (in this function, we could also remove the default columns...)
* @param array $columns
*/
@chibani
chibani / WP : custom posts_per_page for custom post type
Created January 3, 2012 09:45
WordPress : Hack to give a custom posts_per_page value for a custom post type
//This code should be added in the plugin that manages the custom post type or in the functions.php of you theme
add_filter('request', 'hack_pagination');//Register the filter
/**
* Hack to give a custom posts_per_page value for a custom post type
* @param string $query_string automatically given by the filter
*/
function hack_pagination($query_string){
if($query_string['post_type']=='MY_CUSTOM_POST_TYPE' && !is_single() && !is_admin()) {