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
include '../../lib/ezc/Base/src/ezc_bootstrap.php';
$imap = new ezcMailImapTransport( "imap.server.fr" );
$imap->authenticate( "login", "pass" );
$imap->selectMailbox( 'INBOX' );
$set = $imap->fetchAll();
$parser = new ezcMailParser();
@charlycoste
charlycoste / ics-parser.php
Created November 20, 2013 10:30
iCalendar parser
<?php
/**
* This PHP-Class should only read a iCal-File (*.ics), parse it and give an
* array with its content.
*
* PHP Version 5
*
* @category Parser
* @package Ics-parser
* @author Martin Thoma <info@martin-thoma.de>
@charlycoste
charlycoste / issues.php
Created November 6, 2013 22:33
Export issues of a project
<?php
$api = "https://api.github.com";
$owner = "";
$repo = "";
$issues = json_decode(file_get_contents( "{$api}/repos/{$owner}/{$repo}/issues" ));
foreach ($issues as $issue)
{
echo "#".$issue->number."\n";
# import oauth2
import oauth2 as oauth
import urlparse
# defining endpoints
request_token_url = ''
authorize_url = ''
access_token_url = ''
# defining variables
<?php
/**
* @see http://www.croes.org/gerald/blog/ecrire-un-client-rest-en-php-23/490/
*/
class RestClient
{
private $_url;
public function setUrl ($pUrl)
{
$this->_url = $pUrl;
<?php
class Table
{
private $name;
public function __construct( $name )
{
$this->name = $name;
}
# Backbone.js 1.0.0
# (c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc.
# (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
# Backbone may be freely distributed under the MIT license.
# For all details and documentation:
# http:#backbonejs.org
(->
FadeTransitionRegion = Backbone.Marionette.Region.extend
show: (view)->
@ensureEl()
view.render()
@close ->
return if @currentView and @currentView isnt view
@currentView = view
<?php
/**
* @author Charles-Edouard Coste
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
*/
include_once 'ezc/Base/ezc_bootstrap.php';
$soap_request = <<<EOD
@charlycoste
charlycoste / ancestors.sql
Last active December 21, 2015 22:59
Fetches all fields of all ancestors for the node 267 (works only with postgresql)
WITH RECURSIVE ezcontentobject_ancestors(node_id, parent_node_id) AS (
SELECT node_id, parent_node_id
FROM ezcontentobject_tree
WHERE parent_node_id > 0
UNION
SELECT parents.node_id, ancestors.parent_node_id
FROM ezcontentobject_tree as parents, ezcontentobject_ancestors as ancestors
WHERE parents.parent_node_id = ancestors.node_id