Warsaw, Poland
tomandquery@gmail.com

Tomasz Rutkowski

Notes and varieties

Loader JS – TAQ

/* * taq-loader plugin * * how to use? * * add jQuery, js to html * <script src="https://code.jquery.com/jquery-2.2.0.min.js"></script> * <script src="taq-loader/taq-loader.js"></script> * * optionally styles link, instead of styles in js can be used...
Read more

Symfony 2 – Create Project

Console: composer create-project symfony/framework-standard-edition project_name 2.5 php app/check.php php app/console doctrine:database:create php app/console generate:bundle –namespace=Name/NameBundle –format=yml php app/console doctrine:generate:entity php app/console doctrine:schema:update –dump-sql (to see what the changes will do) php app/console doctrine:schema:update –force php...
Read more

Regular Expression for PL Data

nip = ^(\(d{3}-\d{3}-\d{2}-\d{2})|(d{3}-\d{2}-\d{2}-\d{3})$ pesel = ^\d{11}$ regon = ^\d{9}$ tel= ^[0-9]+-?[0-9]+-?[0-9]+-?[0-9]+-?[0-9]*$ postal = ^\d{2}-\d{3}$ numeric = ^[0-9\.\-\+]+$ date = ^\d{4}(-\d{2}){2}$ litery = ^[ĄĆ??????ÓŚŹŻąćęłńóśźż\s-0-9A-Za-z_\'\"&\(\),\.]*$
Read more

Regular Expressions – Examples

Decimals input Positive Integers ^\d+$ Negative Integers ^-\d+$ Integer ^-?\d+$ Positive Number ^\d*\.?\d+$ Negative Number ^-\d*\.?\d+$ Positive Number or Negative Number ^-?\d*\.?\d+$ Phone number ^\+?[\d\s]{3,}$ Phone with code ^\+?[\d\s]+\(?[\d\s]{10,}$ Year 1900-2099 ^(19|20)\d{2}$ Date (dd mm...
Read more

Regular Expressions – Most Popular

Username  /^[a-z0-9_-]{3,16}$/ Password /^[a-z0-9_-]{6,18}$/ Hex Value /^#?([a-f0-9]{6}|[a-f0-9]{3})$/ Slug /^[a-z0-9-]+$/ Email /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ URL /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ IP Address /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ HTML Tag /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/  
Read more
1 13 14 15