Skip to content

Instantly share code, notes, and snippets.

@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":
[
@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 / .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 / 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}$/;
/* 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 / .aliases
Created May 14, 2015 15:02
Shell aliases (require tig)
alias g="git"
alias ga="git add"
alias gaa="git add -A ."
alias gb="git branch"
alias gc="git commit"
alias gcam="tig status; git commit --amend"
alias gce="git commit --allow-empty"
alias gcl="git clone"
alias gcm="git commit -m"
alias gco="git checkout"
@lcasartelli
lcasartelli / emotion-api-lambda.js
Created April 14, 2016 17:46
Lambda code for simple demo with Microsoft Emotion API
const request = require('request');
const POX_EMOTION_API_KEY = '6aad043727374c6d9d7d010eb82f1275'
const exampleImage = 'https://thoughtcatalog.files.wordpress.com/2014/07/harry-potter-and-the-deathly-hallows-trailer-hits-the-web-video-6f199ae35b.jpg';
const handler = exports.handler = (event, context, callback) => {
request({
method: 'POST',
body: JSON.stringify({ "url": exampleImage }),
headers: {
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->

Keybase proof

I hereby claim:

  • I am lcasartelli on github.
  • I am lcasartelli (https://keybase.io/lcasartelli) on keybase.
  • I have a public key ASDFESuwkhCHUJV6TkrX0qJbtxkY5yy1j_7UKh0dNH7pvwo

To claim this, I am signing this object:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}