A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
| <?php | |
| /** | |
| * THIS GIST IS ABOUT HOW TO TEST FOR CLASS CONSTANTS IN PHP INSIDE AND OUTSIDE THE CLASS | |
| * @author Adebola Samuel Olowofela <[email protected]> | |
| * @link https://github.com/samcrosoft | |
| * @class SampleClass | |
| */ | |
| class SampleClass | |
| { |
A list of amazingly awesome PHP libraries, resources and shiny things.
| <?php | |
| /** | |
| * Method to generate random date between two dates | |
| * @param $sStartDate | |
| * @param $sEndDate | |
| * @param string $sFormat | |
| * @return bool|string | |
| */ | |
| function randomDate($sStartDate, $sEndDate, $sFormat = 'Y-m-d H:i:s') | |
| { |
| <!doctype html> | |
| <html ng-app="appProject"> | |
| <head> | |
| <title>Angular: Cross Controller Object Sharing Service example</title> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.js"></script> | |
| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0-rc2/css/bootstrap.css"/> | |
| <script> | |
| oSettings = new Object(); | |
| oSettings = { |
| $rootScope.safeApply(function() { | |
| alert('No worries bro, you are safe'); | |
| }); | |
| // in controllers | |
| $scope.safeApply(function(){ | |
| alert("Keep Calm dude, you are safe"); | |
| }); |
| Since I was looking all around how to uninstall packages and after reading tones | |
| of documentations here's the short how-to uninstall a workbench package in Laravel | |
| (or how I managed it to work out): | |
| 1. Remove package service provider from 'providers' array in app/config/app.php | |
| 2. Remove the package folder in workbench/ | |
| 3. Run: |
vagrant plugin install vagrant-winnfsd| #!/bin/bash | |
| echo "--------------------------------------------------------------------------------------------" | |
| echo "Installing Predis on Ubuntu 12.04" | |
| echo "Read more: https://github.com/nrk/predis" | |
| echo "Author: Ralf Rottmann | @ralf | http://rottmann.net" | |
| echo "--------------------------------------------------------------------------------------------" | |
| PHP5_CONF_DIR="/etc/php5/conf.d" | |
| PHP_INCLUDE_DIR="/usr/share/php5" | |
| echo "Checking prerequisites..." | |
| echo "Git available?" |
| /** | |
| * Create a radio button input field. | |
| * | |
| * @param string $name | |
| * @param mixed $value | |
| * @param bool $mDefault - this can be the default value for the radio | |
| * @param bool $checked | |
| * @param array $options | |
| * @return string | |
| * @static |
| @if($errors->has()) | |
| @foreach ($errors->all() as $error) | |
| <p class="error">{!! $error !!}</p> | |
| @endforeach | |
| @endif |