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 / ezcPersistentXmlManager.php
Created March 10, 2014 17:30
Persistent Manager avec prise en charge de XML
<?php
class ezcPersistentXmlManager extends ezcPersistentDefinitionManager
{
private $file;
public function __construct( $file )
{
if( file_exists($file) )
$this->file = $file;
}
{{! DO NOT EDIT THIS FILE! Use an override template instead. }}
<form method="post" action={{ action }}>
<div class="maincontentheader">
<h1>{{ title }}</h1>
</div>
{{# warnings }}
<div class="warning">
<h2>{{ title }}</h2>
namespace :db do
desc 'Loads one of the backup made with the db:export:remote task'
task :import_to_local do
end
desc 'Creates a backup from a remote database server'
task :backup, :roles => :db do
end
@charlycoste
charlycoste / exemple.csv
Last active August 29, 2015 13:55
Génère une liste aléatoire de sha1, avec leurs alias, sans collision. Ce script peut être rejoué avec une limite supérieure (la variable $max) pour générer de nouveaux sha1 sans écraser les anciens. J'ai écrit ce script pour numéroter mes documents comptables de façon unique tout en pouvant y faire référence simplement par leur alias.
71 71A2FE8DBBBD2B7C60083CFFC4714FAE6860D668
F7 F70F565F1FD894CCD0FC9F9CD3BB327C83603A89
89 899DF47D3C425BFA64FF0CB46139BA639FC1E348
DF DFD7BEE64B0882557415C95B803F0EBFC5D4E31C
22 22EE2B60CB7FEF3D6FFF9F2E7E81574DBCB52CC7
B2 B2270E7BFBCD9FCEF5DFDB5FABAB6694E1FF9BE8
D9 D99D4328DAA150B2D0C0846B0217BF0BADDBBAB2
39 39BA9D49DBFF3C56A3E3FEFC9B89BF8F4A07D084
0C 0C1812FC972EE469A6822DAEB8E43626ADBD5297
08 086C7549AC945C681A4848C6CD679998D8B76B78
{use $compte, $tableau}
<table>
<thead>
<tr><th>Débit</th><th colspan="4">{$compte}</th><th>Crédit</th></tr>
</thead>
<tbody>
<tr>
<th>Dates</th><th>Libellés</th><th>Sommes</th>
<th>Dates</th><th>Libellés</th><th>Sommes</th>
</tr>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?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