Skip to content

Instantly share code, notes, and snippets.

@phenix-factory
phenix-factory / attr.html
Last active April 29, 2019 09:41
Handle #attr
<form #f="ngForm" (ngSubmit)="saveDocument()">
<!-- General info -->
<table class="document-modal__info-table">
<thead>
<tr>
<th>
{{ 'general.general_info' | translate }}
</th>
<th class="text-right" colspan="2">
<a
@phenix-factory
phenix-factory / .gitignore_global
Created December 30, 2016 13:18
gitignore global
#Backup
*~
# Fichier OSX
.DS_Store
.AppleDouble
.LSOverride
Icon
# Fichier de projet Sublime text
@phenix-factory
phenix-factory / spip_vertige.sh
Created October 17, 2016 11:58
spip_vertige install
#!/bin/bash
# Placer le fichier spip.gitignore
wget https://gist.githubusercontent.com/phenix-factory/7134623/raw/edfa67dadab5956c292060404511bb14951a3b18/spip.gitignore -O .gitignore
# Placer le fichier spip.git-ftp-ignore
wget https://gist.githubusercontent.com/phenix-factory/92c90bad7955e0e8e69e/raw/a711f8c67f1698681516b2493c0420bfda8e78ed/spip.git-ftp-ignore -O .git-ftp-ignore
# Créer les répertoire que le spip_loader ne créer pas
mkdir plugins
@phenix-factory
phenix-factory / send_file_to_browser.php
Created August 5, 2016 13:07
PHP : envoyer un fichier au navigateur
<?php
$size = filesize($file);
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '.$size);
@phenix-factory
phenix-factory / auteurs_objet.php
Last active March 16, 2016 11:31
SPIP: auteurs_objet
<?php
/**
* Fonction générique qui permet de renvoyer les auteurs d'un objet
*
* @param string $objet
* @param int $id_objet
* @param string $cond
* @access public
* @return array
*/
@phenix-factory
phenix-factory / vider_cache_lien.php
Last active March 1, 2016 13:51
SPIP: vider le cache de l'objet associer
<?php
/**
* On passe par le pipeline post_edition_lien
* afin de vider le cache des objet associer
* Pratique lorsqu'une structure dépend d'un mot-clé SPIP
*
* @param mixed $flux
* @access public
* @return mixed
*/
@phenix-factory
phenix-factory / cinamon_emacs_layout.sh
Created February 9, 2016 16:43
Cinnamon: Utiliser les raccoucis emacs
# Source: https://github.com/linuxmint/Cinnamon/issues/3816#issuecomment-71325627
gsettings set org.cinnamon.desktop.interface gtk-key-theme "Emacs"
@phenix-factory
phenix-factory / spip.git-ftp-ignore
Created January 28, 2016 16:25
SPIP: git ftp ignore
# Ne pas faire les mises à jour/installation de plugin via git-ftp
plugins/auto/*
@phenix-factory
phenix-factory / is_array_multi.php
Last active December 1, 2015 16:03
PHP: Tester si un tableau est multidimensionel
<?php
/**
* Tester si un tableau est multidimensionel
* Voir http://stackoverflow.com/a/145348
*
* @param array $a
* @access public
* @return bool
*/
function is_array_multi($a) {
@phenix-factory
phenix-factory / convertInnoDBtoMyISAM.sh
Created November 2, 2015 16:47
Convertir InnoDB en MyISQM
zcat ntf-20151102.sql.gz | sed s/InnoDB/MyISAM/ | mysql -u root -proot ntf