Skip to content

Instantly share code, notes, and snippets.

View max-maxymenko's full-sized avatar
🌴
On vacation

Max Maxymenko max-maxymenko

🌴
On vacation
  • -
  • Perth, Australia
View GitHub Profile
@max-maxymenko
max-maxymenko / dummy-web-server.py
Created February 20, 2018 13:32 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@max-maxymenko
max-maxymenko / image-embed-html.php
Created February 3, 2016 08:50 — forked from jasny/image-embed-html.php
Create base64 encoded image to embed in HTML
<?php
$files = array_slice($argv, 1);
foreach ($files as $file) {
$picture = file_get_contents($file);
$size = getimagesize($file);
// base64 encode the binary data, then break it into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
@max-maxymenko
max-maxymenko / php-html-css-js-minifier.php
Created January 15, 2016 08:58 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {