Skip to content

Instantly share code, notes, and snippets.

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
View login.mustache
{{! 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>
View db.rake
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 Aug 29, 2015
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.
View exemple.csv
71 71A2FE8DBBBD2B7C60083CFFC4714FAE6860D668
F7 F70F565F1FD894CCD0FC9F9CD3BB327C83603A89
89 899DF47D3C425BFA64FF0CB46139BA639FC1E348
DF DFD7BEE64B0882557415C95B803F0EBFC5D4E31C
22 22EE2B60CB7FEF3D6FFF9F2E7E81574DBCB52CC7
B2 B2270E7BFBCD9FCEF5DFDB5FABAB6694E1FF9BE8
D9 D99D4328DAA150B2D0C0846B0217BF0BADDBBAB2
39 39BA9D49DBFF3C56A3E3FEFC9B89BF8F4A07D084
0C 0C1812FC972EE469A6822DAEB8E43626ADBD5297
08 086C7549AC945C681A4848C6CD679998D8B76B78
View compte.ezt
{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>
View solar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mail_processing.php
<?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();
View ics-parser.php
<?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 Nov 6, 2013
Export issues of a project
View issues.php
<?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";
View oauth.py
# import oauth2
import oauth2 as oauth
import urlparse
# defining endpoints
request_token_url = ''
authorize_url = ''
access_token_url = ''
# defining variables
View rest.php
<?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;