Skip to content

Instantly share code, notes, and snippets.

View samcrosoft's full-sized avatar

Adebola Samuel Olowofela samcrosoft

View GitHub Profile
#!/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?"
  1. This works on Linux guests only
  2. Amend your Vagrantfile accordingly
  3. Run vagrant plugin install vagrant-winnfsd
  4. Say thanks to @GM-Alex for his amazing work.
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:
@samcrosoft
samcrosoft / HowToRunIt.js
Last active August 29, 2015 14:01
global safe Apply in Angular js. Stored in the $rootScope
$rootScope.safeApply(function() {
alert('No worries bro, you are safe');
});
// in controllers
$scope.safeApply(function(){
alert("Keep Calm dude, you are safe");
});
@samcrosoft
samcrosoft / 1.html
Created September 25, 2013 12:47
This gist demonstrates how you can use a service into storing and manipulating global objects accross multiple controllers.
<!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 = {
@samcrosoft
samcrosoft / random_dates.php
Created September 13, 2013 13:09
A PHP Method to generate random dates between two dates specificed with a format
<?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')
{

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@samcrosoft
samcrosoft / testStaticVariable.php
Created February 12, 2013 15:26
This gist is about how to test for class constants defined inside a class from within the class or outside the class
<?php
/**
* THIS GIST IS ABOUT HOW TO TEST FOR CLASS CONSTANTS IN PHP INSIDE AND OUTSIDE THE CLASS
* @author Adebola Samuel Olowofela <samcrosoft@gmail.com>
* @link https://github.com/samcrosoft
* @class SampleClass
*/
class SampleClass
{