Skip to content

Instantly share code, notes, and snippets.

View Kindari's full-sized avatar

William Cahill-Manley Kindari

  • San Diego, California
View GitHub Profile
@Kindari
Kindari / hello.md.blade.php
Created July 28, 2013 07:08
Example of extending layouts with laravel-markdown https://github.com/Kindari/laravel-markdown/
@extends('test')
@section('content')
##Test 2
@parent
@stop
@Kindari
Kindari / hello.md.blade.php
Created July 28, 2013 07:05
Example of extending layouts with laravel-markdown https://github.com/Kindari/laravel-markdown/
@extends('test')
@section('content')
##Test 2
@parent
@stop
@Kindari
Kindari / routes.php
Last active December 17, 2015 20:39
<?php
Route::get('1', function()
{
return View::make('test1');
});
Route::get('2', function()
{
return View::make('test2')->with('message', 'Test 2 - Php');
@Kindari
Kindari / routes.php
Created March 18, 2013 15:59
Role based router filtering for Laravel 3
<?php
Route::get('protected', array('before' => 'auth|has_role:admin', function(){
return "sekrit";
}));
Route::filter('has_role', function($role) {
if ( ! Auth::user()->has_role($role) ) {
return 'unauthorized';
}
<?php // application/models/user.php
class User extends Eloquent
{
public static $hidden = array('password');
public function set_password($value)
{
return $this->attributes['password'] = Hash::make($value);
}
@section('content')
Some Content
@endsection
@section('title')
Some Content | @parent
@endsection
def send(self, command, *args, **kwargs):
#data is base64 encoded later
data = kwargs.pop('data', None)
# all commands must have a transaction id
tid = self.transaction_id
parts = [command, '-i %d' % tid]
if args: # extra arguments
@Kindari
Kindari / PageController.php
Created November 24, 2012 12:28 — forked from aranw/PageController.php
Caching issue
<?php
class PageController extends Controller {
/**
* Blog Posts
*
* @var array
**/
protected $posts;
Foo
@yield('content')
Bar
@Kindari
Kindari / gist:4070375
Created November 14, 2012 05:05
app/start/artisan.php
<?php
/*
|--------------------------------------------------------------------------
| Register The Artisan Commands
|--------------------------------------------------------------------------
|
| Each available Artisan command must be registered with the console so
| that it is available to be called. We'll register every command so
| the console gets access to each of the command object instances.