Skip to content

Instantly share code, notes, and snippets.

@selawe
selawe / README.md
Created November 5, 2019 14:09 — forked from tmilos/README.md
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@selawe
selawe / 00. tutorial.md
Created January 19, 2017 22:28 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
<?php
function dHash($file, $size = 8)
{
$hash = '';
list($w, $h, $t) = getimagesize($file);
$im = imagecreatetruecolor($size + 1, $size);
imagefilter($im, IMG_FILTER_GRAYSCALE);
switch($t) {
case 1:
@selawe
selawe / PHPExcel_Basics.md
Created March 13, 2016 04:41 — forked from r-sal/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@selawe
selawe / FileUplaoder
Last active August 29, 2015 14:27
A simple multi-fileupload Javascript Class
(function(window) {
'use strict';
/**
*
* @description A Class, that can store files for upload with javascript/ajax
* @class FileUplaoder
*/
window.FileUplaoder = function() {
var fileCache = {}, i = 0;