This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use flate2::write::{GzEncoder}; | |
use flate2::Compression; | |
use std::fs::File; | |
use reqwest::blocking::Client; | |
use std::error; | |
use std::fs; | |
use reqwest::header::CONTENT_LENGTH; | |
use reqwest::header::AUTHORIZATION; | |
use reqwest::blocking::multipart::Form; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Login with php-opencloud and Identity v3 is really badly explained. | |
* | |
* Here is a bit of code that allows you to easily connect to your OpenStack using Keystone (Identity) v3 | |
*/ | |
use OpenStack\ObjectStore\v1\Service; | |
use OpenStack\OpenStack; | |
use Psr\Log\LoggerInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clean a string and return it with only letters, numbers, «.», «-» and «_» | |
* Spaces are replaced by «_» | |
*/ | |
public function cleanName(string $filename) : string | |
{ | |
return preg_replace("/[^.a-zA-Z0-9_-]+/", "", | |
transliterator_transliterate('Any-Latin;Latin-ASCII;', | |
str_replace(' ', '_', $filename))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
final class ImageFactory | |
{ | |
public static function getResource(string $filePath): \GdImage | |
{ | |
if (!is_file($filePath)) { | |
throw new IOException('File «' . $filePath . '» was not found'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
/** | |
* Created by PhpStorm. | |
* User: david | |
* Date: 15/02/2017 | |
* Time: 08:01 | |
*/ | |
namespace AppBundle\Services; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form:not('.special'){ | |
display: block; | |
margin: auto; | |
width: 214px; | |
border: 1px solid gray; | |
padding: 7px; | |
border-radius: 15px; | |
} | |
form#formLogin input:not([type="checkbox"]), form#formRegister input:not([type="checkbox"]), form#formRequest input:not([type="checkbox"]){ | |
width: 25vw; |