Skip to content

Instantly share code, notes, and snippets.

View racztiborzoltan's full-sized avatar

Rácz Tibor Zoltán racztiborzoltan

View GitHub Profile
@racztiborzoltan
racztiborzoltan / remove_public_from_url.php
Created September 17, 2018 07:25
remove "/public" from url
<?php
// =============================================================================
// remove "/public" from url:
//
call_user_func(function(){
// bad:
// $_SERVER['REQUEST_URI'] /__RELATIVE_PATH_TO_PAGE_ROOT__/public/__PAGE_RELATIVE_URL__
// good:
// $_SERVER['REQUEST_URI'] /__RELATIVE_PATH_TO_PAGE_ROOT__/page_relative_url
@racztiborzoltan
racztiborzoltan / category_tree_select.sql
Last active September 4, 2018 08:34
category tree SQL SELECT with hungarian comments
--
-- SQL utasítás, amely faszerkezetbe rendezett kategóriákat tud
-- maximum 3 szintig listázni.
-- Az eredményt lineárisan bejárva a programozási nyelvben is lehet
-- egy több dimenziós tömböt felépíteni, mert nem fog előfordulni,
-- hogy a felsőbb szint esetleg később jönne a listában!
--
SELECT
-- TODO: További oszlopokat szabadon hozzáadni!
@racztiborzoltan
racztiborzoltan / random_string.php
Created July 6, 2018 09:27
PHP: generate random string
/**
* Generate random string
*
* Strong password definition on strongpasswordgenerator.com
* - at least 15 characters
* - uppercase and lowercase letters
* - numbers
* - symbols, such as ` ! " ? $ ? % ^ & * ( ) _ - + = { [ } ] : ; @ ' ~ # | \ < , > . ? /
*
* @param number $length
@racztiborzoltan
racztiborzoltan / simple_psr0_autoloader.php
Created February 12, 2017 18:02
Simple PSR0 autoloader function
<?php
spl_autoload_register(function($class_name){
$path = realpath(__DIR__.'../../classes/'. str_replace('\\', '/', $class_name).'.php');
if ($path) {
require_once $path;
}
return class_exists($class_name, false);
}, true);
@racztiborzoltan
racztiborzoltan / Object.toQueryString.js
Created March 19, 2016 22:05
object to query string and query string to object conversation
/**
* Convert Object to URL query string
*
* Usage:
* var object = {param1:123,param2:'something',param3:'another',param4:null,param5:'',bla:{param10:'I am nested!',array2:[20,'test',40.56],ja:{param6:'really_nested'}},test_array:[10,'foobar',30.5]};
* var query = object.toQueryString();
* Result: "param1=123&param2=something&param3=another&param4&param5=&bla[param10]=I%20am%20nested!&bla[array2][]=20&bla[array2][]=test&bla[array2][]=40.56&bla[ja][param6]=really_nested&test_array[]=10&test_array[]=foobar&test_array[]=30.5"
*
* @version 1.0
*
@racztiborzoltan
racztiborzoltan / NOTES.md
Last active March 19, 2016 01:58
NOTES: PHALCON v2.0.10 --> v2.1.0

NOTES: PHALCON v2.0.10 --> v2.1.0

Phalcon\Loader.php

removed properties 
	protected $_prefixes;

removed methods

public function registerPrefixes($prefixes, $merge=null){ }

@racztiborzoltan
racztiborzoltan / phpinfo.php
Last active July 20, 2018 15:40
phpinfo.php with links on top
<center><?php array_map(function($i){ echo '<a href="?info='.$i.'">'.$i.'</a> | ';}, array('ALL','GENERAL','CREDITS','CONFIGURATION','MODULES','ENVIRONMENT','VARIABLES','LICENSE'));?></center>
<?php phpinfo(@constant('INFO_'.((isset($_GET['info']))?$_GET['info']:'ALL')));
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:blogger="http://www.blogger.hu/blogger">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<blogger:css>
<![CDATA[/*
-----------------------------------------------
Sablon: RedPassion
Dátum: 2010.04.01
----------------------------------------------- */
@racztiborzoltan
racztiborzoltan / shopping_cart.html
Created May 23, 2012 08:32
Simple shopping cart symbol with pure CSS and HTML code
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shoping Cart in CSS</title>
<style type="text/css">
.shopping_cart{
position: relative;
word-spacing: -1em;