Skip to content

Instantly share code, notes, and snippets.


Václav Šír VaclavSir

View GitHub Profile

Keybase proof

I hereby claim:

  • I am vaclavsir on github.
  • I am vaclavsir ( on keybase.
  • I have a public key ASCkrZLdR5A2e52GUmPaRlhhiowbq7CzpM2qMue4_eg9wgo

To claim this, I am signing this object:

View article-react-1.html
data-embed-props='{"recipient": "World"}'
VaclavSir /
Created Mar 16, 2017
How to read articles at
  1. Open developer tools.
  2. Open Console.
  3. Execute $('#content')[0].style.margin='0 auto'
VaclavSir / tmp.js
Created Feb 20, 2017
package.json: Find duplicities between devDependencies and dependencies
View tmp.js
const packageJson = require('./package.json');
Object.keys(packageJson.devDependencies).filter(packageName => packageJson.dependencies.hasOwnProperty(packageName))
View service.php
abstract class Service
public function doSomething()
VaclavSir /
Created Dec 3, 2016
Why Is Context-Aware Escaping a Leaky Abstraction

This is what the documentation says:

All is done automatically, consistently and correctly. You don't have to worry about security holes.

This is simply not true. What if you write this:

<a href="javascript:{$variable}">...</a>
View Nette 2.2
x@ACER2 /d (master)
$ /c/xampp/apache/bin/ab -n 1000 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
VaclavSir / dumpArray.php
Last active Aug 29, 2015
{{ dump_array({'foo': 'bar'}) }}
View dumpArray.php
class AcmeDemoExtension extends \Twig_Extension {
public function getFunctions() {
return [
'dump_array' => new \Twig_Function_Method($this, 'dumpArray'),
public function dumpArray($arrayLikeObject, $indentLevel = 1) {
for SUBDIR in $(ls -d -- */)
echo -ne "."
CMD="git log --all --grep='$1' 2>/dev/null"
RESULT=$(eval $CMD)
if [[ "$RESULT" != "" ]]
View BasePresenter.php
abstract class BasePresenter extends Nette\Application\UI\Presenter
* Path to theme templates.
* @var string