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
<?php
$ext_dir = pathinfo(dirname(dirname(__FILE__)), PATHINFO_BASENAME);
eval('function ' . $ext_dir . '_ContentActionHandler(&$module, &$http, &$objectID){$a = new stdClass; var_dump($a);}');
// myextension_ContentActionHandler(new stdClass, new stdClass, new stdClass);
@charlycoste
charlycoste / ezbackbone.coffee
Last active December 18, 2015 19:19
This is the code needed to load an object from eZ Publish with javascript, thanks to Backbone.js
eZContentObject = Backbone.Model.extend
urlRoot:
$.ez.url + 'call/ezjscnode::load::ezobject_'
url:
() -> @urlRoot + @get 'id'
parse:
(response) -> response.content
#!/usr/bin/python
# -*- coding: utf-8 -*-
import _mysql
import sys
con = ""
try:
con = _mysql.connect( host='mysql.ebi.ac.uk',
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
printf("Content-Type: text/plain;\n\n");
printf("ok");
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://static.synap.fr/jquery.js"></script>
<script type="text/javascript">
$(function(){
var min=0,max=11;
function filter() {
@charlycoste
charlycoste / locations.php
Last active December 14, 2015 08:19
eZ Publish export tools
<?php
$dom = new DOMDocument();
$dom->formatOutput = true;
$node = eZContentObjectTreeNode::fetch(1);
function export($eznode, $parent, $dom) {
$element = $dom->createElement('node');
@charlycoste
charlycoste / jquery.ui.core.sass
Last active December 12, 2015 03:09
Jquery stylesheets with compass
/*!
* jQuery UI CSS Framework 1.9.2
* http://jqueryui.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
@charlycoste
charlycoste / screenshot.js
Created January 31, 2013 17:12
CasperJS script utils
var captureCount = 1;
var startTime = new Date().getTime();
var screenshotPath = 'screenshots';
function screenshot(casper) {
casper.capture(screenshotPath+'/'+startTime+'/'+captureCount+'.png');
captureCount++;
}
@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

<?php
class OpenSSLCert
{
protected $options;
protected $pkey;
public function __construct(OpenSSLCertOptions $options, OpenSSLKey $key)
{
$this->options = $options;
$this->pkey = $key;