Skip to content

Instantly share code, notes, and snippets.

View vwasteels's full-sized avatar
🎶

Vincent Wasteels vwasteels

🎶
View GitHub Profile
<?php
// post_type : flux
register_post_type( 'flux', array(
'labels' => array(
'name' => 'Flux',
'singular_name' => 'Flux',
'add_new' => 'Écrire un flux',
'add_new_item' => 'Écrire un flux',
'edit_item' => 'Modifier le flux',
'new_item' => 'Nouveau flux',
@vwasteels
vwasteels / Sass - state handling.md
Last active August 29, 2015 14:13
sass state parent vs child

Handling parent state vs child state with SASS

.papa {
  &-enfant {
    &.selected {}
    .danger & {}
  }
}
@vwasteels
vwasteels / gist:c88a9b8cb7a09209469f
Created May 4, 2015 19:02
Class example for Xavinouchou
var Tile = function(width, height) {
this.width = width;
this.height = height;
this.size = this.width * this.height;
};
Tile.prototype = {
get el() {
return '<div>MyTile</div>';
@vwasteels
vwasteels / getMenuHierarchically.md
Last active June 28, 2022 13:12
Retrieve menu items hierarchically in Wordpress
/**
 * Get Menu Items From Location
 *
 * @param $location : location slug given as key in register_nav_menus
 */

function getMenuItemsFromLocation($location) {
	$theme_locations = get_nav_menu_locations();
@vwasteels
vwasteels / index.js
Created January 19, 2016 20:03
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var State = require('ampersand-state');
var Collection = require('ampersand-collection');
var Instance = State.extend({
props: {
id: 'number',
slug: 'string',
@vwasteels
vwasteels / gist:df6477b0358ab9146d4abd47718e059f
Last active February 18, 2017 08:09
npm install fail on raspberry
0 info it worked if it ends with ok
1 verbose cli [ '/home/pi/.nvm/versions/node/v6.9.5/bin/node',
1 verbose cli '/home/pi/.nvm/versions/node/v6.9.5/bin/npm',
1 verbose cli 'install' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
@vwasteels
vwasteels / wp-subfolder-templates.php
Last active June 23, 2022 10:04
WP : page templates in sub folders
<?php
/* Pages templates in subfolders */
/*
This will add ./pages/my-custom-folder/*.php templates
if no "Template Name: My name" is specified, name will be : "Subfolder > Filename"
*/