Skip to content

Instantly share code, notes, and snippets.

@mistergraphx
mistergraphx / buildIndex_nav.js
Created January 6, 2017 10:53
Create a navigation with a .md file structure, read title and description from frontmatter datas
/* Building an index of elements : pages,post, …
https://medium.com/@bushwazi/super-simple-static-site-generation-with-node-jade-gulp-and-json-9ded83508fa6#.hvt5p0bqm
https://github.com/Bushwazi/static-site-generation-with-jade-gulp/blob/master/_src/gulpfile.js
*/
// https://www.npmjs.com/package/gulp-gray-matter
// https://www.npmjs.com/package/gray-matter#options
@mistergraphx
mistergraphx / _color-swatches-input-HTML.jade
Last active January 30, 2018 14:15
Playing with Color swatches
.wrapper
h1
|Playing with Color swatches
ul.color-swatch
li
li
li
li
li
li
@mistergraphx
mistergraphx / SassMeister-input-HTML.html
Last active November 17, 2017 06:59
Generated by SassMeister.com.
<main container>
<div row>
<p column>Full-width is default</p>
<p column="2 +3">2 +3</p>
</div>
<div row>
<section column>
<p>8</p>
@mistergraphx
mistergraphx / .htaccess
Last active May 1, 2021 13:01
! Attention de ne pas tout ajouter d'un coup sur un site en production !
##############################################################
# Fichier .htaccess SPIP v 3 #
# #
# V 1.1.6 #
# #
# Permet de controler les URLs et la version de php utilisee #
# Compatible avec les URLs 'html', 'propres' et 'propres2' #
# Permet aussi d'effectuer la transition de .PHP 3 vers .PHP #
# #
# Pour utiliser ce fichier renommez-le '.htaccess' dans le #
<?php
if (!defined("_ECRIRE_INC_VERSION")) return;
// Warning : Maximum function nesting level of '100'
// Principalement pour l'export de configuration avec ieconfig
ini_set('xdebug.max_nesting_level', 200);
/*
* Inscrire ici le nom du site d'administration du tableau de bord
@mistergraphx
mistergraphx / checkout_distrib.sh
Last active November 27, 2017 17:08
Effectue le checkout svn d'une liste de repositories /Depots via un fichier distrib.txt
#!/bin/bash
WORKING_DIR='/Users/macbook/Sites/test_distrib/plugins/'
LISTE='/Users/macbook/Sites/test_distrib/plugins/distrib.txt'
#DEPOTS
# Raccourcis pour les urls des racines de dépots
#JANGOO='svn://un_certain_depot.net/mistergraphx/jangoo_plugins/'
ZONE_PLUGINS='svn://zone.spip.org/spip-zone/_plugins_/'
#PUBLIC='svn://un_depot_par_defaut.net/spip_plugin/public_plugins/'
<!--
https://developers.google.com/analytics/devguides/collection/analyticsjs/
-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=__ANALITIC_ID__"></script>
@mistergraphx
mistergraphx / rsync_linux_advanced.md
Last active December 29, 2017 14:21
Installation de rsync, sur un hébergement de type linux advanced chez Amen, pour pouvoir utiliser en ssh ou depuis l'hébergement l'utilitaire rsync en CLI.

Sur les hébergement de type linux avec cpanel chez Amen, rsync n'est pas installé par defaut, ce qui provoque une erreur quand on veut lancer un script de synchro locale vers l'hébergement en ssh.

rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: remote command not found (code 127) at io.c(453) [receiver=x.x.x]

On installe donc rsync dans le dossier /bin à la racine de l'hébergement.

@mistergraphx
mistergraphx / box.php
Last active February 8, 2018 13:16
SPIP Déclarer une nouvelle wheel à TextWheel
<?php
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
// @see http://zone.spip.org/trac/spip-zone/browser/_plugins_/todo/trunk/wheels/todo.php
// test : http://lumadis.be/regex/test_regex.php?id=3254
// Extraction de lignes du texte
// La wheel renvoie un tableau à cette callback qui est le résultat d'un preg_match_all.
@mistergraphx
mistergraphx / inc-dateur.html
Created January 8, 2018 14:33
Spip - Dateur : exclure des jours et les WE du datepicker
<script type='text/javascript'>/*<![CDATA[*/
function date_picker_options(){
return {
buttonText: '<:afficher_calendrier|texte_script:>',
buttonImage: '#CHEMIN_IMAGE{calendrier-16.png}',
buttonImageOnly: true,
closeText: '<:bouton_fermer|texte_script:>',
prevText: '<:precedent|texte_script:>',
nextText: '<:suivant|texte_script:>',
currentText: '<:date_aujourdhui|texte_script:>',