Skip to content

Instantly share code, notes, and snippets.

@VicVicos
VicVicos / .htaccess
Created May 16, 2019 04:42 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@VicVicos
VicVicos / restore_tree.php
Created April 25, 2019 11:23 — forked from max-dark/restore_tree.php
restore tree from table
<?php
/**
* @file https://gist.github.com/max-dark/f39028cc106ed32e8ce1b55a11643b43
*/
define('ROOT_NODE', null);
/**
* восстанавливает дерево по таблице связей
* @param array $data
@VicVicos
VicVicos / handle_file_upload.php
Created March 29, 2018 02:04 — forked from ebidel/handle_file_upload.php
Uploading files using xhr.send(FormData) to PHP server
<?php
$fileName = $_FILES['afile']['name'];
$fileType = $_FILES['afile']['type'];
$fileContent = file_get_contents($_FILES['afile']['tmp_name']);
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent);
$json = json_encode(array(
'name' => $fileName,
'type' => $fileType,
'dataUrl' => $dataUrl,