Skip to content

Instantly share code, notes, and snippets.

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update

@brunocoelho
brunocoelho / regex-string-whitelist.js
Created June 20, 2018 22:07 — forked from steveosoule/regex-string-whitelist.js
JavaScript Regular Expression Whitelist for String
// in the regex, the carrot(^) negates the match, so if the stringToReplace contains something that is not a-z or 0-9 it will be replaced
// In this case the desired string will only be alpha numeric characters, stripping out spaces and symbols
// Help from: http://stackoverflow.com/questions/4374822/javascript-regexp-remove-all-special-characters
var desired = stringToReplace.replace(/[^a-zA-Z0-9]/gi, '')