Skip to content

Instantly share code, notes, and snippets.

Michaël Marinetti Asenar

Block or report user

Report or block Asenar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2593862
private function getCurrentRule() {
$return = false;
$rules = array_reverse($this->getRules());
$today = time() ;
$year = Date('Y') ;
$day = Date('d') ;
$month = Date('m') ;
Asenar /
Last active Oct 5, 2015
massive search and replace multiline when you have an old html website to modify. Theses scripts has been used to add google analytic tracker in <head> , and to convert an html website to "basic php", replacing html main blocs like headers, footers and menus by a php inclusion + renaming file html to php
# Author: Michaël Marinetti
# Description: in each files ( $ext extension)
# if they not contains $search add $content (absolute path) before $add_before (a vim regex, beginning with / or ?)
Asenar / gist:2916695
Created Jun 12, 2012
afficher les sauts de ligne dans AdminLogs
View gist:2916695
$ svn diff
Index: classes/AdminTab.php
--- classes/AdminTab.php (revision 15980)
+++ classes/AdminTab.php (working copy)
@@ -1524,6 +1524,8 @@
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang);
elseif (isset($params['type']) AND $params['type'] == 'datetime')
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang, true);
+ elseif (isset($params['type']) AND $params['type'] == 'log')
View gist:2935331
Etat HTTP 500 -
type Rapport d'exception
description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
Asenar / etc-ssh-sshd_config
Created Jun 21, 2012
fichier de configuration pour chrooter les utilisateurs qui utilisent ce moyen
View etc-ssh-sshd_config
1) chown root:sftp /home/web -R
fortement basé sur , et un grand merci à la communauté freenode/gandi-hosting !
# Package generated configuration file
# See the sshd_config(5) manpage for details
Asenar / post-receive
Created Sep 3, 2012
what's the best way to make this hooks working when the "git fetch" is on an other server ?
View post-receive
read oldrev newrev refname
if (test "$branch" = "develop") then
cd $dir_develop
Asenar / bashrc.bash
Last active Oct 11, 2015
script for testing fancy prompt with 2 colors
View bashrc.bash
# list of colors, just what I use for test
txtrst=\[\033[00m\] # no color
txtred=\[\033[31m\] # Red
txtred=\[\033[32m\] # Green
txtblu=\[\033[34m\] # Blue
Asenar / Firstpage.php
Created Oct 31, 2012
something like this
View Firstpage.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en" dir="ltr">
<link href="/js/jquery/jquery.cleditor.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.cleditor.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.form.js"></script>
<script type="text/javascript">
View test.vim
" progressively check higher values... falls out on first "true"
" (note addition of zero ... this guarantees return from function is numeric
if strftime("%H") < 6 + 0
colorscheme darkblue
echo "setting colorscheme to darkblue"
elseif strftime("%H") < 12 + 0
colorscheme morning
echo "setting colorscheme to morning"
elseif strftime("%H") < 18 + 0
colorscheme shine
Asenar / deploy
Last active Dec 11, 2015
[draft] deploy with gitolite. This is a draft, feel free to comment. This is not bug free (yet), some push may not work properly. Pushing tags produce an error (or something like that), and there is something by pushing new branches
View deploy
# file : serveur-prod:/home/git/scripts/deploy
# desc : This script deploy a pushed branch in web directory specified in conf/$repo-name.conf
# author : Michaël Marinetti
# creation : 2012-09-07
# modified : 2013-01-24
You can’t perform that action at this time.