Skip to content

Instantly share code, notes, and snippets.

View samcrosoft's full-sized avatar

Adebola Samuel Olowofela samcrosoft

View GitHub Profile
@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");
});
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:
  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.
#!/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?"
@samcrosoft
samcrosoft / forms.php
Created March 2, 2015 11:27
This is a macro that will help you create a radio button that will compare a default value with the old request, this is a really helpful improvement over the radio method of laravel
/**
* 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
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
@samcrosoft
samcrosoft / symfony2_nginx.conf
Last active August 29, 2015 14:26 — forked from ZipoKing/symfony2_nginx.conf
Sample nginx configuration for Symfony2
server {
listen 80;
server_name symfony2;
root /var/www/symfony2/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
# strip app.php/ prefix if it is present
@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
{

Awesome PHP

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

Composer

Composer Related

@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 = {