Skip to content

Instantly share code, notes, and snippets.

View arozwalak's full-sized avatar

Artur Rozwalak arozwalak

View GitHub Profile
@arozwalak
arozwalak / www
Last active December 28, 2015 02:39
RegExp: with or without 'www'
^(?:www\.|)webpage\.com$
Match
www.webpage.com
webpage.com
@arozwalak
arozwalak / http
Last active December 28, 2015 02:39
RegExp: with or without "http://"
(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?
RegExp: /(?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi
pattern: (?:(?:http|https):\/\/)?([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?
flags: gi
1 capturing groups:
group 1: ([-a-zA-Z0-9.]{2,256}\.[a-z]{2,4})
@arozwalak
arozwalak / npm
Last active December 28, 2015 05:09
NodeJs: Node.js NPM proxy configuration
npm config set proxy http://domain\\user:[email protected]:8080
npm config set https-proxy http://domain\\user:[email protected]:8080
@arozwalak
arozwalak / form.html
Last active December 28, 2015 07:29
HTML5: HTML5 Forms
<form>
<input type="email" placeholder="Enter your e-mail" required> // Validation of email
<input type="url">
<input type="range" min="1" max="100" step="5">
<input type="tel" pattern="\d{3}-\d{3}-\d{4}">
<input type="number">
<input type="submit">
<progress min="0" max="100" value="0"></progress>
<meter min="0" max="100" value="50">50</meter>
</form>
@arozwalak
arozwalak / email.txt
Created November 14, 2013 10:13
RegExp: Email validation
^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$
@arozwalak
arozwalak / index.html
Last active December 28, 2015 07:59
HTML5: Range Inputs
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<dl>
<dt>Red</dt>
<dd><input id="r" type="range" min="0" max="255"></dd>
@arozwalak
arozwalak / index.html
Last active March 9, 2017 22:08
Javascript: Feature detection
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Feature Detection</title>
</head>
<body>
<input type="text" placeholder="John Doe">
<input type="email">
<script>
@arozwalak
arozwalak / index.html
Last active March 9, 2017 22:08
Javascript: Modernizr
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Modernizr</title>
<style>
.flexbox {
}
.no-flexbox .container {
@arozwalak
arozwalak / history.html
Last active December 28, 2015 09:59
HTML5: History API
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>History API</title>
</head>
<body>
<ul>
<li><a href="img/Penguins.jpg" title="Penguin" data-url="penguin">Penguin</a></li>
<li><a href="img/Chrysanthemum.jpg" title="Chrysanthemum" data-url="chrysanth">Chrysanthemum</a></li>
@arozwalak
arozwalak / localstorage.html
Last active December 28, 2015 10:38
HTML5: localStorage
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<title>localStorage</title>
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<style>
label, input { display: block; }
textarea { width: 300px; height: 150px; }