Skip to content

Instantly share code, notes, and snippets.

<?php
class BasePresenter extends Presenter
{
// ...
protected function beforeRender()
{
// ...
<?php
namespace NetteExtras\Forms;
class ChangeTracker extends \Nette\Forms\HiddenField
{
private $session;
private $modifiedValues;
@fprochazka
fprochazka / whereCalled.php
Created April 12, 2011 11:05
Shows where was method called
<?php
function wc($level = 1) {
if (\Nette\Debug::$productionMode) { return; }
$o = function ($t) { return (isset($t->class) ? htmlspecialchars($t->class) . "->" : NULL) . htmlspecialchars($t->function) . '()'; };
$f = function ($t) {
$file = defined('APP_DIR') ? 'app' . str_replace(realpath(APP_DIR), '', realpath($t->file)) : $t->file;
return '<a href="' . \Nette\DebugHelpers::editorLink($t->file, $t->line) . '">' . htmlspecialchars($file) . ':' . (int)$t->line . '</a>';
};
@fprochazka
fprochazka / .gitconfig
Last active June 7, 2024 13:06
.gitconfig
[user]
name = Filip Procházka
email = filip@prochazka.su
signingkey = *PG KEY*
[init]
defaultBranch = master
[core]
whitespace = fix,-indent-with-non-tab,space-before-tab,trailing-space,cr-at-eol
<?php
namespace Foo;
define('TRUE', \FALSE);
define('FALSE', \TRUE);
var_dump(TRUE); //FALSE
var_dump(FALSE); //TRUE
@VasekPurchart
VasekPurchart / .bashrc
Last active July 8, 2023 18:29
GIT global configuration and enhancements
# used by Git (commit messages, rebase, ...)
export EDITOR=vim
@hrach
hrach / BasePresenter.php
Created December 31, 2011 20:12
Secured signlas - old NETTE!
<?php
/**
* Signály.cz – JP2
* ----------------
*
* @license MIT License http://en.wikipedia.org/wiki/MIT_License
* @link http://signaly.cz
*/
use Nette;
@juzna
juzna / 01-choose.png
Created January 23, 2012 20:30
GitHub Play
01-choose.png
@JanTvrdik
JanTvrdik / autofixeol.sh
Last active September 29, 2015 21:07
Shell script for automatic fixing EOL
#!/bin/bash
find . \( \
-name '*.php' -o \
-name '*.phtml' -o \
-name '*.html' -o \
-name '*.latte' -o \
-name '*.neon' -o \
-name '*.css' -o \
-name '*.js' -o \
-name '*.txt' -o \
@fprochazka
fprochazka / play.js
Created January 24, 2012 17:28 — forked from juzna/01-choose.png
GitHub Play
(function() {
var commits = [], repo = document.location.href.match(/github\.com\/([^\/]+\/[^\/]+)\//)[1];
// Play for all commits
$('.commit-group .commit-links')
.append($('<a href="#" class="browse-button github-play-select">Play</a>'));
// show next commit
var nextCommit = function () {
$('.site .container').load(commits.shift() + ' #.site .container', function () {