Skip to content

Instantly share code, notes, and snippets.


Jan Kuchař jkuchar

View GitHub Profile
View 5-icu-with-xml.php
translate('cannotContinue', [
'linkFix' => Html::el('a')->href('https://somewhere')
jkuchar / 4-icu-with-xml.php
Last active Mar 26, 2020
View 4-icu-with-xml.php
$link = Html::el('a')->href('https://somewhere');
translate('cannotContinue', [
'linkStart' => $link->startTag(),
'linkEnd' => $link->endTag(),
jkuchar / 3-icu.php
Last active Mar 26, 2020
View 3-icu.php
translate('cannotContinue', [
'link' => 'https://somewhere'
View 1.html
You cannot continue, <a href="http://somewhere">click here</a> to fix problem.
jkuchar / 2-gettext.php
Last active Mar 26, 2020
How (not) to do localization
View 2-gettext.php
echo translate("You cannot continue,")
echo '<a href="http://somewhere">';
echo translate('click here');
echo '</a>';
echo translate('to fix problem.');
jkuchar / regexp
Created Sep 8, 2018
How to find all calls to link generator in Nette?
View regexp
Use this regexp for example in PHPStorm:
(link\(|redirect\(|forward\(|n:href|\{plink |\{link )
View Pozvání uživatele do systému.php
// 1. prepare invitation
$invitation = $accounts->prepareInvitation(EmailAddress::of(''), 7);
// 2. check invitation code (OK)
$tempIdentity = $accounts->authenticateWithTemporaryToken(
jkuchar / loop.php
Created May 28, 2017
SplFixedArray - infinite loop
View loop.php
// Arrange
$object = new SplFixedArray(2);
$object[0] = 'first-value';
$object[1] = 'second-value';
// Act
foreach ($object as $key1 => $val1) {
jkuchar / styler-chrome-extension.css
Last active Jun 16, 2017
Fira Code Font in GitLab
View styler-chrome-extension.css
/* 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 / dockerfile
Created Mar 28, 2017
How to cache npm, yarn, bower and composer into /cache folder in GitLab CI
View dockerfile
# 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
You can’t perform that action at this time.