Skip to content

Instantly share code, notes, and snippets.

View charlycoste's full-sized avatar
🏃‍♂️
migrated to my own gitlab and gitlab.com #ByeMicrosoft

Charles-Édouard Coste charlycoste

🏃‍♂️
migrated to my own gitlab and gitlab.com #ByeMicrosoft
View GitHub Profile
@charlycoste
charlycoste / ez-bookmarks-to-user-subnodes.php
Created January 6, 2013 08:58
Makes User objects as containers and move all articles bookmarks to users subnodes.
<?php
$output = new ezcConsoleOutput();
$options = array(
'successChar' => $output->formatText( '+', 'success' ),
'failureChar' => $output->formatText( '-', 'failure' ),
);
$status = new ezcConsoleStatusbar( $output, $options );
$script = eZScript::instance();
@charlycoste
charlycoste / menu.html
Last active December 10, 2015 17:18
Responsive menu system with media queries
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul>
<li><a href="#"><span>Item 1</span></a></li>
<li><a href="#"><span>Item 2</span></a></li>
@charlycoste
charlycoste / form.html
Last active December 10, 2015 17:18
Login form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form method="post" action="/">
<fieldset>
<legend>Login</legend>
$("dt").toggle( function(){$(this).nextAll().show()},
function(){$(this).nextAll().hide()})
.nextAll().hide();
<?php
//
// Definition of ezjscServerFunctionsJs class
//
// Created on: <16-Jun-2008 00:00:00 ar>
//
// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
// SOFTWARE NAME: eZ JSCore extension for eZ Publish
// SOFTWARE RELEASE: 4.3.0
// COPYRIGHT NOTICE: Copyright (C) 1999-2010 eZ Systems AS
// see http://www.creativejuiz.fr/blog/tutoriels/jquery-effet-smooth-scroll-defilement-fluide
$('a[href^="#"]').click(function(){
var the_id = $(this).attr("href");
$('html, body').animate({
scrollTop:$(the_id).offset().top
}, 'slow');
return false;
});
(function( $ ) {
$.fn.show_hide = function(bloc1, bloc2, text1, text2, text3, u1, u2, u3, nodeId) {
return this.each(function(){
var bouton = $(this);
var parent = $(bloc1);
var bloc = parent.find(bloc2);
@charlycoste
charlycoste / gradient.php
Last active December 11, 2015 07:28
Gradient generator
<?php
// get some values for the params from get; we also have some default values that render an 100x100 image with a horizontal gradient from black to white
$width = 100;
if (isset($_GET['width'])) // the width of out output pic
{
$width = filter_var($_GET['width'], FILTER_VALIDATE_INT); // I am not using filter_input without the isset() test because some applications will use url rewriting
}
$height = 100;
if (isset($_GET['height'])) // height of the pic
{
<?php
class OpenSSLCert
{
protected $options;
protected $pkey;
public function __construct(OpenSSLCertOptions $options, OpenSSLKey $key)
{
$this->options = $options;
$this->pkey = $key;
@charlycoste
charlycoste / cheatsheet.md
Created January 30, 2013 15:57
Cheatsheet PNG optimisation

optipng -o7 picture.png

pngout picture.png compressed.png

pngcrush -reduce -brute picture.png compressed.png

advpng -4 -z picture.png