Skip to content

Instantly share code, notes, and snippets.

View Taluu's full-sized avatar
🖕
vim is the true editor !

Baptiste Clavié Taluu

🖕
vim is the true editor !
View GitHub Profile
@Taluu
Taluu / ansi_to_utf8.php
Created October 31, 2010 17:07
Convert a ANSI file to an UTF8 file
<?php
/**
* Convertit un ensemble de fichiers de format ANSI en UTF8.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@Taluu
Taluu / gist:e2e3c5a66136e0e21869
Created May 24, 2011 23:16
Projet à reprendre ? :o
<?php
/**
* Gestion de feuilles de styles CSS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@Taluu
Taluu / vivi.py
Created March 23, 2012 10:22 — forked from anonymous/vivi
python code vianney
# -*- coding: cp1252 -*-
"""décomposition de la base d'image MNIST"""
import os
import struct
import PIL # ligne à supprimer si on n'a pas besoin des images
import PIL.Image as PIM # ligne à supprimer si on n'a pas besoin des images
def transcription_entier (str) :
"""convertit un entier lu en format binaire en entier"""
@Taluu
Taluu / MockEntityManager.php
Last active February 18, 2023 16:59
Mock some services for PHPUnit
<?php
namespace Traits\Tests;
/**
* Mocks the entity manager
*
* Provides everything in the memory, so the tests does not depend on doctrine,
* which does a lot of stuff (maybe too much). This also allows to avoid to
* need and modify the data in the database, even if those are for the tests.
@Taluu
Taluu / gist:4434568
Last active December 10, 2015 12:29 — forked from anonymous/gist:4434564
plans_block_title: "Welcome into Wisembly's community !"
plans_block_intro: "More than 200 enterprises in the world are using Wisembly. Join the community and manage memorables meetups."
free_use: "\o/ A job for captain obvious. I think."
abo_now: "Suscribe now"
free_claim: "Create a new wiz in 30 seconds. It is free, and you won't need any credit cards."
create_your_wiz: "Captain obvious is asked at the reception desk. Thank you."
label_email: "Email"
free_wiz_notice: "Your wiz will be operationnal but will be limited up to 5 users"
abo_claim: "You will have to pay monthly (without any engagements), regardless of the number of events you have. It is simple and yet so flexible !"
@Taluu
Taluu / feature.php
Last active December 10, 2015 22:38
<?php
class ApiContext
{
//...
/**
* Sends a request with a body and token
* This function is used to pass an array in the JSON. If your data is only simple values, prefer sendRequestWithTokenAndValues
*
* @Given /^I sent a post request (?:on|to) "(?P<url>(?:[^"]|\\")*)" with my token and this body :$/
@Taluu
Taluu / gist:4584914
Created January 21, 2013 09:46
Mail to GD
<?php
define('MAIL_PLUS_WIDTH', 10);
define('MAIL_PLUS_HEIGHT', 10);
define('MAIL_POS_WIDTH', (MAIL_PLUS_WIDTH / 2) );
define('MAIL_POS_HEIGHT', (MAIL_PLUS_HEIGHT / 2) );
/**
* Transform a adresse mail to GD.
* @param string $mail mail du membre
* @param string $where ou l'enregistrer ?
<?php
// php wtf of the day
use \DateTime,
\DateInterval;
$now = ['ref'=> new DateTime(), 0 => new DateTime(), 1 => new DateTime];
$interval = new DateInterval('PT10S');
// Have to do this to make it work. Just putting it here, so we can analyse the difference
<service id="un.service" class="%un.service%">
<argument type="service" id="doctrine.orm.entity_manager" />
<argument type="service" id="validator" />
<!-- etc //-->
</service>
@Taluu
Taluu / gist:6111938
Last active December 20, 2015 09:59
dafuq ?!
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 42,
j = 42,
k = 42,
sum = 0;