This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
const CACHED_PREFIX = 'c_'; | |
/** | |
* Call to cached or undefined method. | |
* @param string method name | |
* @param array arguments | |
* @return mixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GravatarPresenter extends \Nette\Application\UI\Presenter | |
{ | |
public function actionDefault($email, $size = 80) | |
{ | |
$this->sendResponse(new GravatarResponse($email, $size)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
sudo -s | |
rm -rf Downloads | |
ln -s /Volumes/Media/Downloads/Storage Downloads | |
rm -rf Music | |
ln -s /Volumes/Media/Music Music | |
rm -rf Pictures | |
ln -s /Volumes/Media/Images Pictures | |
rm -rf Documents | |
ln -s /Volumes/Media/Documents Documents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Model; | |
class Post extends BaseModel | |
{ | |
/** @var int */ | |
private $id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = 'http://twidaq.com/account/my-portfolio/'; | |
$session = ''; // Tohle je jedinej problém, ale má velikou expiraci, takže to stačí jednou za čas opravit | |
$domain = 'twidaq.com'; | |
$path = '/'; | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_URL, $uri); | |
// curl_setopt($c, CURLOPT_FOLLOWLOCATION, TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title><$BlogPageTitle$></title> | |
<$BlogMetaData$> | |
<style type="text/css"> | |
body {margin-top: 1.0em; font-family: Helvetica, Arial, FreeSans, san-serif;} | |
#container {margin: 0 auto; width: 700px;} | |
h1, h2 {color: #2B2;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$foo = (bool) FALSE; | |
var_dump($foo); // FALSE, expected FALSE | |
$foo++; | |
var_dump($foo); // FALSE, expected TRUE | |
$foo++; | |
var_dump($foo); // FALSE, expected TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function templatePrepareFilters($template) { | |
$template->registerFilter($latte = new Nette\Templates\LatteFilter()); | |
TwigMacro::register($latte->getHandler()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "./Breto/libs/nette/loader.php"; | |
class CustomDump | |
{ | |
static public $file; | |
static function setFile($file) { | |
self::$file = $file; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/' | |
} | |
export PS1='\[\e[1;37m\][\u\[\e[1;37m\]@:\[\e[1;36m\]\w\[\e[1;33m\]$(parse_git_branch)\[\e[1;37m\]]$ \[\e[0m\]' |