The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| <?php | |
| function generateToken($length = 24) { | |
| if(function_exists('openssl_random_pseudo_bytes')) { | |
| $token = base64_encode(openssl_random_pseudo_bytes($length, $strong)); | |
| if($strong == TRUE) | |
| return strtr(substr($token, 0, $length), '+/=', '-_,'); //base64 is about 33% longer, so we need to truncate the result | |
| } | |
| //fallback to mt_rand if php < 5.3 or no openssl available | |
| $characters = '0123456789'; |
| • SSH to your server to start creating a subdomain (https://library.linode.com/hosting-website#sph_configuring-name-based-virtual-hosts) | |
| • Go to ~/public/ | |
| › mkdir -p sub.example.com/{public,log,backup} | |
| › cd sub.example.com/public/ | |
| › nano index.html | nano index.php | |
| • Write 'Hello world' or whatever, we just need a html|php file to test with |
There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.
The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.
When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].
When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"