Skip to content

Instantly share code, notes, and snippets.

View nilesolutions's full-sized avatar

Ahmed Samy nilesolutions

  • Abu dhabi
View GitHub Profile
# macOS Sierra v. 10.12 Setup
[View a more detailed explanation of these steps here.](https://www.taniarascia.com/setting-up-a-brand-new-mac-for-development/)
This is a simple list of instructions to make setting up your Apple computer as fast and efficient as possible for front end web development.
## Preferences
- **Keyboard > Text >** Disable "Correct spelling automatically".
- **Security and Privacy > Firewall >** On
For security code, please don't generate your tokens this way: `$token = md5(uniqid(rand(), TRUE));`
* [`rand()` is predictable](https://jazzy.id.au/2010/09/20/cracking_random_number_generators_part_1.html)
* [`uniqid()` only adds up to 29 bits of entropy](http://securitymaverick.com/php-uniqid-entropy-analysis-and-potentially-vulnerable-apps)
* `md5()` doesn't add entropy, it just mixes it deterministically
Try this out:
## Generating a CSRF Token
### PHP 7
@nilesolutions
nilesolutions / gist:d1baa681afcfe14b7e24c23616f9147c
Created March 23, 2017 19:02
OS X 10.10 Yosemite Local Development Environment: Apache, PHP, and MySQL with Homebrew
Homebrew Setup
If you've not already installed Homebrew, you can follow the instructions at http://brew.sh. I used to include the command in previous walkthrough blogs, but it could change after posting, so definitely check their website to install it properly.
If you do not have git available on your system, either from Homebrew, Xcode, or another source, you can install it with Homebrew now (if you already have it installed, feel free to skip this step to keep the version of git you already have):
brew install -v git
PATH Variable
In previous guides on 10.9 and earlier, I added a change to $PATH in ~/.bash_profile to ensure that Homebrew-installed applications would run by default over similar ones that were already installed on OS X. Thankfully, Yosemite's $PATH order is different than earlier OS versions and now includes the default Homebrew location of /usr/local/bin in front. If you installed Homebrew to a custom location, or are not seeing /usr/local/bin at the beginning of your shell's $PATH, chec