Skip to content

Instantly share code, notes, and snippets.

View jkuchar's full-sized avatar

Jan Kuchař jkuchar

View GitHub Profile
@jkuchar
jkuchar / composer.json
Created May 9, 2015 19:26
Nette 2.3 RobotLoader invocation bug
{
"require": {
"nette/application": "~2.3",
"nette/bootstrap": "~2.3"
}
}
@jkuchar
jkuchar / composer.json
Last active August 29, 2015 14:21
git push all in this directory
{
"require": {
"nette/nette": "^2.3"
}
}
@jkuchar
jkuchar / AdvancedSubmitButton.php
Created February 24, 2013 20:12
Graphical submit button for Nette forms. Allows you to put HTML content inside button.
class AdvancedSubmitButton extends SubmitButton {
var $icon = null;
var $showCaption = true;
/**
* @param string caption
* @param string icon url
*/
@jkuchar
jkuchar / keybase.md
Created December 21, 2016 21:22
keybase.md

Keybase proof

I hereby claim:

  • I am jkuchar on github.
  • I am honzakuchar (https://keybase.io/honzakuchar) on keybase.
  • I have a public key whose fingerprint is F7F9 6B1E 3BFF 9BA1 3E6E 9DD2 3CA7 4879 462B 47F2

To claim this, I am signing this object:

@jkuchar
jkuchar / loop.php
Created May 28, 2017 16:06
SplFixedArray - infinite loop
<?php
// https://3v4l.org/LDQ6i
// Arrange
$object = new SplFixedArray(2);
$object[0] = 'first-value';
$object[1] = 'second-value';
// Act
foreach ($object as $key1 => $val1) {
@jkuchar
jkuchar / styler-chrome-extension.css
Last active June 16, 2017 15:26
Fira Code Font in GitLab
/* Use Fira Code */
/* in merge requests */
.diff-file .diff-content table,
.diff-file .diff-content table .line_holder td, /* to properly override line-height and font-size */
.file-content.code .line-numbers a, /* to align line numbers with lines of source */
/* in file view */
.file-content.code pre code
{
@jkuchar
jkuchar / tmux-shortcuts.md
Last active August 9, 2017 18:15
TMUX for dummies

TMUX

Start it using

command what it does?
tmux Starts new tmux session
tmux attach attaches to last openned tmux session

When it is running

@jkuchar
jkuchar / dockerfile
Created March 28, 2017 10:16
How to cache npm, yarn, bower and composer into /cache folder in GitLab CI
# NPM: cache
RUN npm config set cache /cache/.npm
# bower: cache
ENV bower_storage__packages /cache/.bower/packages
ENV bower_storage__registry /cache/.bower/registry
ENV bower_storage__links /cache/.bower/links
# YARN cache
RUN yarn config set cache-folder /cache/yarn
@jkuchar
jkuchar / Pozvání uživatele do systému.php
Created September 4, 2018 19:46
Ukázka scénářových testů
<?php
// 1. prepare invitation
$identityProvider->becomeAdmin();
$invitation = $accounts->prepareInvitation(EmailAddress::of('double-usage@example.com'), 7);
// 2. check invitation code (OK)
$identityProvider->becomeGuest();
$tempIdentity = $accounts->authenticateWithTemporaryToken(
$invitation->getTemporaryAuthenticationToken()
);
@jkuchar
jkuchar / regexp
Created September 8, 2018 17:00
How to find all calls to link generator in Nette?
Use this regexp for example in PHPStorm:
(link\(|redirect\(|forward\(|n:href|\{plink |\{link )