Skip to content

Instantly share code, notes, and snippets.

Jan Majek jancimajek

Block or report user

Report or block jancimajek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jancimajek
jancimajek / cloudSettings
Last active Jul 28, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-07-28T11:33:50.203Z","extensionVersion":"v3.4.1"}
@jancimajek
jancimajek / async-error.ts
Last active Jul 9, 2019
Async error handling
View async-error.ts
import debug from 'debug';
import express, { NextFunction, Request, Response } from 'express';
const testRouter = express.Router();
const delay = async (wait: number, label: string) =>
new Promise(resolve => {
debug('yncx:delay:start')({ wait, label });
setTimeout(() => {
debug('yncx:delay:end')({ wait, label });
View perftest.php
<?php
set_time_limit(0);
interface PerformanceTest
{
public function test($numberOfIteraftion);
}
class PerformanceTester
@jancimajek
jancimajek / .eslintrc.js
Last active Sep 30, 2018
leveluptuts/React-Testing-For-Beginners
View .eslintrc.js
module.exports = {
"parser": "babel-eslint",
"env": {
"jest/globals": true,
"browser": true,
"es6": true
},
"settings": {
"ecmascript": 6,
"jsx": true
View Referer bookmarklet
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 / test.php
Last active Nov 10, 2015
PHP Storm 10 quote escaping when copy&paste
View test.php
<?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 / .bashrc
Last active Oct 12, 2015
My bashrc file
View .bashrc
# 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 / preg_match_replace_test.php
Last active Aug 29, 2015
Test of preg_match replacement
View preg_match_replace_test.php
<?php
t(
array(
'www.notft.com',
'ft.com',
'.ft.com',
'x.ft.com.au',
'x.ft.com',
),
View .gitconfig
[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)
You can’t perform that action at this time.