Skip to content

Instantly share code, notes, and snippets.

View Aurielle's full-sized avatar

Vašek Vrbka Aurielle

View GitHub Profile
@Aurielle
Aurielle / config.neon
Created August 29, 2015 09:36
Globální registrace filtrů do Latte
services:
nette.latteFactory:
setup:
- addFilter(myAwesomeFilter, @App\Latte\MyAwesomeFilter)
- App\Latte\MyAwesomeFilter
- neni dovoleno pouzivat internet
(vyjimky: odkazovany zobrazovac grafu, stazeni zadani a ulozeni reseni do ISu)
- muzete pouzivat sve zdrojaky ulozene na disku notebooku
(v pocitacovych ucebnach pouzijte sdilene domovske adresare)
- muzete pouzivat lokalne ulozene PDF manualy k programovacim jazykum
- vypnete si vsechny synchronizace disku, facebookova okna, aktualizace,...
- vypnute mobily snad ani nemusim zminovat
- pokud uvidime nepovolene okno nebo nepovoleny provoz na siti, dostavate F a
jdete pred disciplinarni komisi
@Aurielle
Aurielle / howto.md
Last active December 14, 2015 16:15
Redis + PHP 5.5 + Windows - howto?

Redis + PHP 5.5 + Windows - howto?

Either compile the extension by yourself using these instructions. Applicable for whatever PHP version you're using.

Alternatively, prebuilt binaries are available for PHP 5.3/5.4 or PHP 5.5. Always download x86 version of the extensions (unless you're using 64bit PHP) and verify that Zend Extension Build and PHP Extension Build correspond to the version you're downloading.

Newer binaries are here: http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/

After you've aquired the two DLLs, put them inside ext folder in your PHP installation and modify php.ini, adding the following:

; php-redis
@Aurielle
Aurielle / keybase.md
Created November 26, 2014 22:11
Keybase.io verification

Keybase proof

I hereby claim:

  • I am Aurielle on github.
  • I am aurielle (https://keybase.io/aurielle) on keybase.
  • I have a public key whose fingerprint is A0A6 28C6 2009 9A15 A33F B4FF 121D A628 E6DA C7F7

To claim this, I am signing this object:

@Aurielle
Aurielle / .htaccess
Created January 18, 2013 15:59
Přesměrování domena.cz na www.domena.cz
RewriteEngine On
# RewriteBase /
# non-www to www xxxxx.cz => www.xxxxx.cz
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
@Aurielle
Aurielle / whatever.php
Created February 11, 2012 16:13
Nekonečně hluboké zanoření - routy
<?php
$catFilterIn = function($slug, $params, $origParams) use($site) {
if(!isset($site->languages[$params['lang']]))
return NULL;
$lang = $site->languages[$params['lang']];
$temp = explode('/', trim($slug, '/'));
$path = array();
$slugs = array();
@Aurielle
Aurielle / boostrap.php
Created January 26, 2012 19:16
Introducing Avalon Framework: bootstrap.php
<?php
// ------- Load Avalon -------
require(LIBS_DIR . '/Avalon/loader.php');
// ------- Basic configuration -------
// * $environment, $debuggerMode, $debuggerEmail and $params
// * are all initialized automatically. Do NOT overwrite $params, just add
// * new values: $params += array('key' => 'value');
//
@Aurielle
Aurielle / Presenter.php
Created November 8, 2011 14:06
Link protection
<?php
public function link($destination, $args = array())
{
if(!is_array($args)) {
$args = func_get_args();
array_shift($args);
}
$a = strpos($destination, '#');
@Aurielle
Aurielle / LanguageTable.php
Created February 3, 2011 16:59
LanguageTable - překladová tabulka pro Route s podporou gettextového překladače
<?php
/**
* Avalon CMS
*
* Copyright (c) 2010 Vaclav Vrbka (http://www.php-info.cz)
*/
namespace Avalon\Application;
use Avalon, Nette;
@Aurielle
Aurielle / BasePresenter.php
Created January 18, 2011 19:33
Koncept n:if-allowed (ověřování ACL v šablonách - Nette Framework) - funkční pouze s n:href
<?php
/*
* Předpokládá ACL následujícího tvaru:
* resource: Jméno presenteru / komponenty (PHP, včetně namespace)
* privilege: Jméno akce / signálu
*/
public function userAllowed($component, $destination = NULL)
{
if($destination === NULL) // No destination specified, can cause unexpected results when used with n:if-allowed as it would check for previous link!