Skip to content

Instantly share code, notes, and snippets.

View fprochazka's full-sized avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
@pavelmaca
pavelmaca / backup.sh
Created November 13, 2010 13:29
backup.sh
#!/bin/bash
# My first shell script :)
# Backup domains directories and MySQL database.
clear
# CONFIGURATION
MODE_D="0740"
MODE_F="0640"
DAY=$(date +%F) # YYYY-MM-DD
@Mikulas
Mikulas / GravatarPresenter.php
Created December 5, 2010 13:59
Gravatar cache for nette
<?php
class GravatarPresenter extends \Nette\Application\UI\Presenter
{
public function actionDefault($email, $size = 80)
{
$this->sendResponse(new GravatarResponse($email, $size));
}
}
@Aurielle
Aurielle / WidgetContainer.php
Created January 12, 2011 15:57
WidgetContainer - spravuje widgety
<?php
/**
* PHP-in' CMS Framework
*
* Copyright (c) 2010 Vaclav Vrbka (http://www.php-info.cz)
*
* This source file is subject to the "PHP-in' CMS Framework licence".
* For more information please see http://www.phpin.eu
*/
@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;
@beberlei
beberlei / SQLFilter.php
Created July 21, 2011 10:46
First idea for SQL Filtering in Doctrine2
<?php
namespace Doctrine\ORM\Query\Filter;
abstract class SQLFilter
{
final public function __construct(Connection $conn);
final function setParameter($name, $value, $type);
@vojtech-dobes
vojtech-dobes / example.latte
Created September 10, 2011 00:37
Latte helpers for HTML 5 data-attributes
{* with helper *}
<div id="with-data" data-example="{[a => b]|data}"></div>
{* with macro *}
<div id="with-data" n:data="example, [a => b]"></div>
<script>
var data = parseDataJson($('#with-data'), 'example');
// => data == {a: 'b'}
</script>
@mishak87
mishak87 / Router.php
Created May 24, 2012 12:01
Router for API REST like methods
<?php
namespace ApiModule;
use Nette,
Nette\Application\Request;
class Router extends Nette\Object implements Nette\Application\IRouter
{
@Mikulas
Mikulas / Google.php
Created August 21, 2012 13:21
GoogleAuth
<?php
use \Nette\Utils\Json;
/**
* Minimalistic Google OAuth2 connector
* @author Mikuláš Dítě
* @license BSD-3
*/
class Google extends Nette\Object
@vojtech-dobes
vojtech-dobes / MultiAuthenticator.php
Created August 31, 2012 12:40
Multiple ways of authentication in Nette
<?php
namespace VojtechDobes\NetteSecurity;
use Nette\InvalidArgumentException;
use Nette\Security\IAuthenticator;
use Nette\Security\IIdentity;
/**