Skip to content

Instantly share code, notes, and snippets.

View tolu360's full-sized avatar
💭
Hacking on lotta awesomeness!

Tolu Olowu tolu360

💭
Hacking on lotta awesomeness!
View GitHub Profile

Awesome PHP

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

Composer

Composer Related

@tolu360
tolu360 / index.html
Created July 16, 2013 11:45
A CodePen by Billy Crist. Switches - The first 2 are designed with depth and lighting, while the 3rd one is flatly designed with a somewhat "gooey"-ish transition on it.
<div class="wrap">
<input type="checkbox" class="slider-v1" id="s1" />
<label for="s1"></label>
<input type="checkbox" class="slider-v1" id="s2" checked="" />
<label for="s2"></label>
</div><!--/wrap-->
<div class="wrap">
<?php
/*
|--------------------------------------------------------------------------
| API Token Filter
|--------------------------------------------------------------------------
|
| Check for a valid access token or throw an Exception.
|
|
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
@tolu360
tolu360 / spinner.css
Last active December 24, 2015 02:19 — forked from jkneb/spinner.css
/*
* Read more here:
* http://front-back.com/a-cool-css-spinner-with-less-variables
*/
/*
* This is a nice full CSS3 loader made with LESS
* so you'll have to compile it into CSS to make it work in your project
* See the doc on the LESS website : http://lesscss.org/
*/
//app/routes.php
Route::post('favorites', ['as' => 'favorites.store', function()
{
if (Request::ajax()) {
$postId = Input::get('post-id');
$favorites = DB::table('favorites')->whereUserId(Auth::user()->id)->lists('post_id');

My Validation Base Class

I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.

<?php

namespace FooProject\Internal\Validators;

use FooProject\Internal\Sanitizers\BaseSanitizer;
@tolu360
tolu360 / upload.php
Created February 25, 2014 17:38 — forked from msurguy/upload.php
ini_set("memory_limit","200M");
if( !empty($_SERVER['HTTP_ORIGIN']) ){
// Enable CORS
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type');
}
if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ){