Skip to content

Instantly share code, notes, and snippets.

/* jshint node:true, indent:2, white:true, laxcomma:true, undef:true, strict:true, unused:true, eqnull:true, camelcase: false, trailing: true */
/*!
* connect-rich-response
* Copyright(c) 2013 Luca Casartelli - Plastic Panda <[email protected]>
* MIT Licensed
*/
@lcasartelli
lcasartelli / regex.js
Created October 23, 2013 14:30
Useful regexes
var email_regex = /^(?:[a-zA-Z0-9!#$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?\^_`{|}~\-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?|\[(?:(?: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]?|[a-zA-Z0-9\-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/;
var uuid_regex = /^[0-9a-zA-Z\-]+$/;
var url_regex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/;
var country_code_regex = /^\+{0,1}[0-9]{1,4}$/;
var phone_regex = /^[0-9\-().\s]{10,15}$/;
@lcasartelli
lcasartelli / .zshrc.sh
Last active December 26, 2015 08:08
ohmyzsh settings
# theme
ZSH_THEME="robbyrussell"
# editor
# sublime
alias sublime='subl'
# brackets
alias brackets="open --new /Applications/Brackets.app $1"
# plugins
@lcasartelli
lcasartelli / Default(OSX).sublime-keymap.json
Created October 23, 2013 14:15
Key Bindings - User for Sublime Text 3
[
{ "keys": ["super+0"], "command": "git_commit" },
{ "keys": ["super+9"], "command": "git_add_choice" },
{ "keys": ["super+shift+9"], "command": "git_add" },
{ "keys": ["super+8"], "command": "git_push_current_branch" },
{ "keys": ["super+7"], "command": "git_pull_current_branch" }
]
@lcasartelli
lcasartelli / Preferences.sublime-settings.json
Last active December 26, 2015 07:59
Settings - User for Sublime Text 3
{
"auto_complete": true,
"coffee_path": "/Users/lcasartelli/.nvm/v0.11.14/bin/coffee",
"color_scheme": "Packages/User/Colorsublime/themes/Afterglow.tmTheme",
"create_window_at_startup": false,
"font_size": 12.0,
"highlight_line": true,
"hot_exit": false,
"ignored_packages":
[