Skip to content

Instantly share code, notes, and snippets.

View jancimajek's full-sized avatar

Jan Majek (Yanchix Ltd) jancimajek

View GitHub Profile
@jancimajek
jancimajek / test.php
Last active November 10, 2015 16:58
PHP Storm 10 quote escaping when copy&paste
<?php
$test = "Copy from here -->" . $foo . "<-- to here and pasting will escape the quotes -->\" . $foo . \"<--";
$test = 'Copy from here -->' . $foo . '<-- to here and pasting will escape the quotes -->\' . $foo . \'<--';
$test = "
lorem ipsum
" . $foo . " // copy this line
\" . $foo . \" // the quotes get escaped on pasting
";
@jancimajek
jancimajek / preg_match_replace_test.php
Last active August 29, 2015 14:16
Test of preg_match replacement
<?php
t(
array(
'www.notft.com',
'ft.com',
'.ft.com',
'x.ft.com.au',
'x.ft.com',
),
@jancimajek
jancimajek / .gitconfig
Last active August 29, 2015 14:05
Git config
[user]
name = Jan Majek
email = jan.majek@ft.com
[push]
# Pushes only curent branch upstream (as opposed to "matching" (default) which would push all branches)
# default = upstream
[credential]
# helper = osxkeychain
[help]
# If there is only one matching command, it will execute it after X dediseconds (1/10s)
javascript:void(function(){%20var%20divId%20=%20'tmLprDiv'%20+%20Math.floor(Math.random()*1000000);%20var%20inputId%20=%20'tmLprUrl'%20+%20Math.floor(Math.random()*1000000);%20var%20divTag%20=%20document.createElement("div");%20divTag.setAttribute("align","center");%20divTag.id%20=%20divId;%20divTag.style.font%20="9pt%20Verdana";%20divTag.style.margin%20=%20"0px%20auto";%20divTag.style.position%20=%20"absolute";%20divTag.style.top%20=%20"10px";%20var%20left%20=%20(screen.width%20-%20350)%20/%202;%20divTag.style.left%20=%20left%20+%20"px";%20divTag.style.padding%20=%20"10px";%20divTag.style.border%20=%20"3px%20solid%20red";%20divTag.style.background%20=%20"white";%20divTag.style.width%20=%20"350px";%20divTag.style.zIndex%20=%20"999";%20divTag.innerHTML%20=%20"<div%20style='float:right;color:red;font-weight:bold;margin:-5px;%200px%2010px%200px;cursor:pointer;'%20onclick='document.body.removeChild(document.getElementById(\""%20+%20divId%20+%20"\"));'>X</div><br%20style='clear:right;'/><div>Landing%20page%20URL:%
@jancimajek
jancimajek / .bashrc
Last active October 12, 2015 01:47
My bashrc file
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
# Support for GIT branch and status info
# @see http://www.bramschoenmakers.nl/en/node/624
# @see http://denis.tumblr.com/post/71390665/adding-bash-completion-for-git-on-mac-os-x-snow-leopard
if [ -f /etc/git-completion.bash ]; then
. /etc/git-completion.bash
@jancimajek
jancimajek / perftest.php
Created February 29, 2012 12:15
Performance test
<?php
set_time_limit(0);
interface PerformanceTest
{
public function test($numberOfIteraftion);
}
class PerformanceTester