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
@fprochazka
fprochazka / oldGrabber.php
Created October 14, 2010 10:16
OLD NHL Grabber reader (just for fun)
<?php
/* ================================ *\
| Grabbe Reader v0.9 by HosipLan |
| Grabbe Saver v0.9 by HosipLan |
| Na NHL Nitex ke hře NHL |
| Http://SportsGamers.Nitex.Cz |
#====================================#
| HosipLan@seznam.cz |
| ICQ: 327671143 |
@fprochazka
fprochazka / LookoutControl.php
Created October 15, 2010 10:41
LookoutControl - Control with fake life cycle
<?php
namespace Kdyby\Control;
use Nette;
use Nette\String;
class LookoutControl extends Nette\Application\Control
<?php
use Curl\MultiRequest;
use Curl\Request;
$testMulti = new MultiRequest($config);
# create request
$testMulti['prevodnik'] = new Request("http://curl.kdyby.org/prevodnik.asm.zdrojak");
@fprochazka
fprochazka / BasePresenter.php
Created October 17, 2010 20:07
Registrování všech statických metod třídy jako helpery
<?php
abstract class BasePresenter extends \Nette\Application\Presenter
{
public function createTemplate()
{
$template = parent::createTemplate();
foreach (get_class_methods('Helpers') AS $method) {
@fprochazka
fprochazka / git-control.sh
Created October 19, 2010 13:52
frees you from typing `git $command`, just type yout `$command` ;-)
#!/bin/bash
git_run() {
gitCommand=""
while [ 1 ] ; do
read -p "git > " -e gitCommand ;
git $gitCommand ;
done
}
@fprochazka
fprochazka / collored_echo.sh
Created October 23, 2010 11:20
`$ colored $blue "text"` prints blue "text" :)
#!/bin/bash
black='\e[0;30m' # Black - Regular
red='\e[0;31m' # Red
green='\e[0;32m' # Green
yellow='\e[0;33m' # Yellow
blue='\e[0;34m' # Blue
purple='\e[0;35m' # Purple
cyan='\e[0;36m' # Cyan
white='\e[0;37m' # White
@fprochazka
fprochazka / git-control.sh
Created October 23, 2010 12:55
funky git controller (sample: http://i55.tinypic.com/ao0038.jpg)
#!/bin/bash
srcLibs="/var/www"
black='\e[0;30m' # Black - Regular
red='\e[0;31m' # Red
green='\e[0;32m' # Green
yellow='\e[0;33m' # Yellow
blue='\e[0;34m' # Blue
purple='\e[0;35m' # Purple
@fprochazka
fprochazka / InfiniteDateTime.php
Created October 25, 2010 08:12
Pro nekonečnou platnost
<?php
class InfiniteDateTime extends \DateTime
{
public function __construct ()
{
parent::__construct('2038-01-19 03:14:00');
}
<?php
namespace Kdyby\Form;
use Nette;
use Kdyby;
/**
* Description of MyControl
@fprochazka
fprochazka / LogicDelegator.php
Created November 10, 2010 14:49
LogicDelegator
<?php
/**
* Pokud je objekt zmrazen půjde pouze volat properties a metody
*/
class LogicDelegator extends Nette\FreezableObject
{
/** @var array */
private $callbacks = array();