Skip to content

Instantly share code, notes, and snippets.

<?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>';
};
@JanTvrdik
JanTvrdik / BasePresenter.php
Created January 2, 2012 10:20 — forked from hrach/BasePresenter.php
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;
@JanTvrdik
JanTvrdik / play.js
Created January 26, 2012 11:43 — forked from fprochazka/play.js
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 () {
@JanTvrdik
JanTvrdik / returning.html
Created December 4, 2012 11:04 — forked from tajo/returning
Return to the position before expanding
<script>
/**
* @author Chamurappi
* @param {DOMElement} element
* @return {function()} callback for restoring saved position
*/
function savePosition(element)
{
if (!element.getBoundingClientRect) return function(){};
var top = element.getBoundingClientRect().top;
@JanTvrdik
JanTvrdik / add_pull_request_to_issue_github.sh
Last active June 6, 2016 19:25
Add pull request to existing issue on github
#!/bin/bash
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)"
current_branch=${current_branch##refs/heads/}
github_username="JanTvrdik"
github_token="..."
if [[ $current_branch = "(unknown)" ]]
then
@JanTvrdik
JanTvrdik / FormMacros.php
Created June 12, 2010 10:49 — forked from janmarek/FormMacros.php
Macros for manual form rendering in Nette Framework
<?php
namespace Nette\Templates;
use Nette;
use Nette\String;
use Nette\Forms\Form;
/**
* Form macros
*
@JanTvrdik
JanTvrdik / example.php
Created March 21, 2017 08:40 — forked from hikari-no-yume/example.php
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@JanTvrdik
JanTvrdik / README.md
Last active May 3, 2017 11:51 — forked from Mikulas/README.md
git-nudge

git-nudge

Same as git push, but suppresses GitHub branch protection for admins on pushed branches.

Installation

Put this file to any location in your $PATH and make it executable.

@JanTvrdik
JanTvrdik / escapeshellrce.md
Created January 4, 2017 10:05 — forked from Zenexer/escapeshellrce.md
Security Advisory: PHP's escapeshellcmd and escapeshellarg are insecure

Paul Buonopane paul@namepros.com at NamePros
PGP: https://keybase.io/zenexer

I'm working on cleaning up this advisory so that it's more informative at a glance. Suggestions are welcome.

This advisory addresses the underlying PHP vulnerabilities behind Dawid Golunski's [CVE-2016-10033][CVE-2016-10033], [CVE-2016-10045][CVE-2016-10045], and [CVE-2016-10074][CVE-2016-10074]. It assumes prior understanding of these vulnerabilities.

This advisory does not yet have associated CVE identifiers.

Summary

@JanTvrdik
JanTvrdik / .bashrc
Last active June 14, 2022 04:14 — forked from gsomoza/.bashrc
ssh-agent support for Git Bash / MinGW / msys / Windows
# put this in ~/.bashrc
export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l > /dev/null
if [ $? = 2 ]; then
rm -f $SSH_AUTH_SOCK
echo Starting new ssh-agent...
eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null
ssh-add && echo "ssh-agent set up successfully with the following keys:" && ssh-add -l
fi