This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
stream_filter_register("utf8encode", "Utf8EncodeFilter"); | |
class Utf8EncodeFilter extends php_user_filter | |
{ | |
function filter($in, $out, &$consumed, $closing) | |
{ | |
while ($bucket = stream_bucket_make_writeable($in)) { | |
$bucket->data = utf8_encode($bucket->data); | |
$consumed += $bucket->datalen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use League\Csv\Writer; | |
require 'vendor/autoload.php'; | |
function generateRandomString($length = 10) | |
{ | |
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$str = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
function getRelativePath($path, $reference) | |
{ | |
//normalisation des parametres | |
$path = (string) $path; | |
if ('/' == $path[0]) { | |
$path = substr($path, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CacheLib; | |
use DateTime; | |
use DateTimeInterface; | |
use DateTimeInterval; | |
use Psr\Cache\CacheItemInterface | |
class CacheItem implements CacheItemInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use League\Csv\Writer; | |
function generateRawData($start, $end) | |
{ | |
for ($i = $start; $i < $end; $i++) { | |
$index = $i; | |
yield [ | |
'cell--'.($index), | |
'cell--'.($index+1), | |
'cell--'.($index+2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pdo = new \PDO( | |
$config['db']['dsn'], | |
$config['db']['username'], | |
$config['db']['password'] | |
); | |
$sql = 'SELECT * FROM `gen_contact` ORDER BY `contact_modified` DESC'; | |
$stmt = $pdo->prepare($sql); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Re-creating Bref style with CSS3 animation */ | |
html, body { margin:0 auto; padding:0; color:#fff; background-color:#444; font-size:18px; line-height:1.5; font-family:Trocchi, Serif; text-align:center; } | |
body { padding-top:100px; } | |
a { color:rgb(252, 96, 0); transition:all .3s linear; } | |
a:hover { color:rgb(232, 199, 69); } | |
ul { margin:0 auto; padding:0; list-style:none; clear:both; overflow:hidden; width:100%; } | |
.wrapper { margin:0 auto 40px; width:400px; padding:0; position:relative; transform:scale(2); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = 'http://www.ics.uci.edu/pub/ietf/uri/#Related'; | |
$regexp = ',^ | |
((?<scheme>[^:/?\#]+):)? # URI scheme component | |
(?<authority>//([^/?\#]*))? # URI authority part | |
(?<path>[^?\#]*) # URI path component | |
(?<query>\?([^\#]*))? # URI query component | |
(?<fragment>\#(.*))? # URI fragment component | |
,x'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gradient Progress bar | |
*/ | |
html, body { background-color:#fff; color:#222; text-align:center; } | |
[class^=loading-] { box-sizing:border-box; margin:1em auto; width:300px; height:20px; } | |
.loading-outer { overflow:hidden; border-radius:.3em; background-color:#f1f1f1; box-shadow:inset 0 0 2px rgba(128, 128, 128, .3); } | |
.loading-inner { | |
margin-top:0; margin-left:100%; | |
background-color:#0ebdf7; | |
background-image:linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Kitt Effect using Efficient CSS Animation | |
*/ | |
html, body { | |
font:normal 100%/1.5 sans-serif; | |
} | |
.kitt, | |
.kitt div, |
OlderNewer