The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: October 8th 2015
- Original post
@setup | |
function env(string $key) { | |
$dotenv = file_get_contents('.env'); | |
$rows = explode("\n", $dotenv); | |
$search = array_filter($rows, function ($row) use ($key) { | |
if (strstr($row, $key)) { | |
return $row; | |
} | |
}); |
<?php | |
class Mock | |
{ | |
/** | |
* Full path of the class name to mock. | |
* | |
* @var string | |
*/ | |
protected $class; |
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the controller to call when that URI is requested. |
<?php | |
namespace App; | |
use ReflectionClass; | |
trait RecordsActivity | |
{ | |
public static $_recordableEvents; |
component(name) { | |
.{name} { | |
{block} | |
} | |
} | |
part(name) { | |
&__{name} { | |
{block} |
* { | |
font-family: 'Operator Mono', 'Inconsolata-dz for Powerline', 'Fira Code', Monaco !important; | |
} | |
html { | |
background: rgb(12, 26, 33); | |
color: rgba(200, 169, 111, 1); | |
} |
var gulp = require('gulp'); | |
var stylus = require('gulp-stylus'); | |
var jade = require('gulp-jade'); | |
var jeet = require('jeet'); | |
var rupture = require('rupture') | |
var path = { | |
views: './app/*.jade', | |
styles: './app/stylus/*.styl' | |
}; |
<?php | |
class Object | |
{ | |
public static function property($object, $property) | |
{ | |
if (! property_exists($object, $property)) { | |
return null; | |
} |
<?php | |
// model | |
public function paginate($page = 1, $order = [], $limit = 10) | |
{ | |
// default values | |
$order = ($order) ?: []; | |
$limit = ($limit) ?: 10; | |
$query = $this->product->take($limit); |