Skip to content

Instantly share code, notes, and snippets.


Mike Castro Demaria mikecastrodemaria

  • Ultra Prod SAS / Supersonique Studio SARL
  • 85 Rue simiane, 06110 Le Cannet, France
View GitHub Profile
View checkbox_input.php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty

PHP-CLI (PHP en ligne de commande) sur les hébergements mutualisés OVH

More complete info here (thanks to @42antoine)


/usr/local/php5.3/bin/php => PHP 5.3.29 (cli) (built: Nov 21 2017 08:55:07)
/usr/local/php5.4/bin/php => PHP 5.4.45 (cli) (built: Nov 21 2017 08:35:51)
/usr/local/php5.5/bin/php => PHP 5.5.38 (cli) (built: Nov 21 2017 08:46:45)

Install php7 with pear

$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php
$ brew install php70 --with-pear

Enable php7 with apache2

mikecastrodemaria / test-doc-see-as-virus-by-clamav.txt
Last active Feb 28, 2018
A simple text file to be used as positive test for ClamAv virus scanner
View test-doc-see-as-virus-by-clamav.txt
View php_mkdir.php
if (!mkdir($output, 0755, true)) {//0755
die('Failed to create folders...');
mikecastrodemaria / mod_rewrite_test.php
Created Dec 20, 2017
A simple test to know if you apache mod_rewrite is loaded
View mod_rewrite_test.php
if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
$res = 'Module Unavailable';
$res = 'Module Available';
<title>A mod_rewrite availability check !</title></head>
mikecastrodemaria / ICS.php
Created Dec 13, 2017 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
* ICS.php
* =======
* Use this class to create an .ics file.
* Usage
* -----
* Basic usage - generate ics file contents (see below for available properties):
mikecastrodemaria / Class file
Last active Mar 25, 2020 — forked from samatsav/Class file
Convert PHP arrays to XLS
View Class file
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
View gist:80dcb98e421b4ee1c4f0f55262576035
charge img_src value buy your own image
needs to be used with a caching system
$img_src = "img/sample.jpg";
$imgbinary = fread(fopen($img_src, "r"), filesize($img_src));
$img_str = base64_encode($imgbinary);
echo '<img src="data:image/jpeg;base64,'.$img_str.'" alt="Alt text" />';