Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Phenix phenix-factory

🏠
Working from home
View GitHub Profile
View attr.html
<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
View .gitignore_global
#Backup
*~
# Fichier OSX
.DS_Store
.AppleDouble
.LSOverride
Icon
# Fichier de projet Sublime text
View spip_vertige.sh
#!/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 Aug 5, 2016
PHP : envoyer un fichier au navigateur
View send_file_to_browser.php
<?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 Mar 16, 2016
SPIP: auteurs_objet
View auteurs_objet.php
<?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 Mar 1, 2016
SPIP: vider le cache de l'objet associer
View vider_cache_lien.php
<?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 Feb 9, 2016
Cinnamon: Utiliser les raccoucis emacs
View cinamon_emacs_layout.sh
# Source: https://github.com/linuxmint/Cinnamon/issues/3816#issuecomment-71325627
gsettings set org.cinnamon.desktop.interface gtk-key-theme "Emacs"
View 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 Dec 1, 2015
PHP: Tester si un tableau est multidimensionel
View is_array_multi.php
<?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) {
View convertInnoDBtoMyISAM.sh
zcat ntf-20151102.sql.gz | sed s/InnoDB/MyISAM/ | mysql -u root -proot ntf