Skip to content

Instantly share code, notes, and snippets.

View Gounlaf's full-sized avatar
🤩
I'm trying to port Magick.NET to Kotlin

Florian Levis Gounlaf

🤩
I'm trying to port Magick.NET to Kotlin
View GitHub Profile
@Gounlaf
Gounlaf / Dockerfile.phiremock
Created March 21, 2019 19:59
Phiremock shipped in a Docker container (buggy version + tests)
#FROM phpearth/php:7.3-cli
#FROM phpearth/php:7.1-cli
FROM php:7.0-cli
EXPOSE 80
ADD https://github.com/mcustiel/phiremock/raw/master/phiremock.phar /usr/local/bin/phiremock.phar
#ADD https://github.com/mcustiel/phiremock/releases/download/v1.11.1/phiremock.phar /usr/local/bin/phiremock.phar
#ADD https://github.com/mcustiel/phiremock/releases/download/v1.10.0/phiremock.phar /usr/local/bin/phiremock.phar
CMD php /usr/local/bin/phiremock.phar -p 80 -i 0.0.0.0

Keybase proof

I hereby claim:

  • I am Gounlaf on github.
  • I am gounlaf (https://keybase.io/gounlaf) on keybase.
  • I have a public key whose fingerprint is 349C 2EC9 F8CE BF80 D73A E34E 0D9D 1C35 2940 C36F

To claim this, I am signing this object:

@Gounlaf
Gounlaf / LikeQueryHelpers.php
Created March 5, 2018 19:34 — forked from johnkary/LikeQueryHelpers.php
Proper DQL escaping for LIKE queries with Doctrine 2.
<?php
namespace Foo;
/**
* Methods for safe LIKE querying.
*/
trait LikeQueryHelpers
{
/**
@Gounlaf
Gounlaf / bugreport-php-stream-base64.php
Last active February 2, 2018 22:16
Test script for php bug reporting related to stream and filter convert.base64-encode #75910
<?php
$testString = 'test';
$stream = fopen('php://memory', 'r+');
fwrite($stream, $testString);
rewind($stream);
$filter = stream_filter_append($stream, 'convert.base64-encode');
echo "encode - low-level - memory = " . stream_get_contents($stream) . PHP_EOL;
$testString = 'dGVzdA==';
$stream = fopen('php://memory', 'r+');
@Gounlaf
Gounlaf / CircleImageTransformation.java
Created September 2, 2016 14:21 — forked from codezjx/CircleImageTransformation.java
A picasso circle image transformation. Optimized version of: https://gist.github.com/julianshen/5829333. Use shader.setLocalMatrix() method to draw circle bitmap not from source bitmap left-top. So, we no need to create square bitmap!
/**
* Created by codezjx on 2016/5/4.
*/
public class CircleImageTransformation implements Transformation {
/**
* A unique key for the transformation, used for caching purposes.
*/
private static final String KEY = "circleImageTransformation";
public static String stringToHardcodedCharArray(@NotNull String s) {
char[] chars = s.toCharArray();
StringBuilder output = new StringBuilder("char[] key = {");
if (chars.length > 0) {
output.append("'").append(chars[0]).append("'");
for (int i = 1; i < chars.length; i++) {
output.append(",'").append(chars[i]).append("'");
@Gounlaf
Gounlaf / installation_minimale_de_latex.md
Created November 6, 2014 15:56
Installation minimale de LaTeX (sur une Debian)
@Gounlaf
Gounlaf / index.php
Last active August 29, 2015 14:02
bootstrapvalidator doesn't work if form submit input/button name is "submit"
<!DOCTYPE html>
<html>
<head>
<title>BootstrapValidator demo</title>
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="dist/css/bootstrapValidator.css" />
</head>
<body>
<?php if(!empty($_POST)) { var_dump($_POST); } ?>
<div class="container">
@Gounlaf
Gounlaf / README
Created April 25, 2014 18:08
PhantomJS and CasperJS under Debian
Make sure to install libfontconfig on Debian to run PhantomJS / CasperJS
public function testZfIssue4619Action()
{
$form = new \Application\Form\Issue4619();
$form->setData(array('testDateTime' => 'asdf'));
// false
Debug::dump($form->isValid());
// 3 validators : Zend\Validator\NotEmpty, Zend\Validator\Date, Zend\Validator\DateStep
Debug::dump($form->getInputFilter()->get('testDateTime')->getValidatorChain()->getValidators());
$form = new \Application\Form\Issue4619();