Skip to content

Instantly share code, notes, and snippets.

@ferdiemmen
ferdiemmen / gist:bb61e424b5f78166d1a463f7b7c3683b
Created December 19, 2017 10:44
Regex which covers all possible e-mail addresses according to the RFC spec
Javascript:
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
Python:
r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"
@ferdiemmen
ferdiemmen / gist:7c52915195b54419fb8e690fed8fe554
Created January 19, 2018 09:02
Bump npm package version
npm version patch -m 'version(package): update to %s'
git push
let cookies = {};
document.cookie.split(' ').map(x => x.replace(/;$/g, '').split('=')).map(x => { cookies[x[0]] = x[1]; return x; });
i solved the same issue recently for this module and others like --> ngx translate and more...
solution (compile the js files into es2015):
npm i --save -dev babel-cli babel-preset-es2015
add this to the root project under the name .babelrc
{ "presets": ["es2015"] }
add a npm script in package.json in "scrtipsts" scope
@ferdiemmen
ferdiemmen / submodule-pull.sh
Created June 13, 2018 21:19 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'