Skip to content

Instantly share code, notes, and snippets.

View morrislaptop's full-sized avatar

Craig Morris morrislaptop

View GitHub Profile
elixir(function(imix) {
// Workflow stuff
imix.sass('app.scss')
.coffee()
.phpUnit()
.wiredep();
// Build stuff
if (elixir.config.production) {
<?php namespace App\Bridges;
use ReflectionClass;
trait LaravelFivePackageTrait {
public function boot()
{
$this->loadViewsFrom($this->namespace, $this->guessPackagePath() . '/views');
$this->loadTranslationsFrom($this->namespace, $this->guessPackagePath() . '/lang');
<?php namespace FestivalPlaylists\Bridges;
use Laracasts\Flash\FlashServiceProvider as BaseFlashServiceProvider;
class FlashServiceProvider extends BaseFlashServiceProvider {
var $namespace = 'flash';
var $vendor = 'laracasts';
use LaravelFivePackageTrait;
function db_query($query)
{
$result = mysql_query($query) or sql_error($query);
return $result;
}
function sql_error($query)
{
$message = "DATABASE ERROR \n QUERY: $query \n ERROR: " . mysql_error();
$out = '<hr><strong>DATABASE ERROR</strong><hr><pre><p><div><em>The query was</em> : </div><div>' . htmlentities($query) . '</div></p><p><div><em>MySQL Said</em> : </div><div>' . mysql_error() . '</div></p></pre><hr>';
@morrislaptop
morrislaptop / stateMock.js
Last active November 23, 2015 08:51 — forked from wilsonwc/stateMock.js
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.current = {};
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
faker.seed(100);
var frozen = 153665219; // Grab this value from a previous build
var seed = 1 ? frozen : (new Date).getTime() % 1000000000; // change 1 to 0 to switch between random or frozen
console.log("This seed is " + seed);
faker.seed(seed);
<li>
<a href="#">
<img src="{{image.image(280, 160, true)}}" width="280" height="160" />
<div class="caption">
<i class="pe-7s-{{helpers.randomize(['news-paper', 'global', 'science'])}} pe-3x"></i>
<div>
<strong>{{name.findName}}</strong><br />
<span>{{random.number(31)}} {{date.month}} {{random.number({min: 2000, max: 2015})}}</span>
</div>
</div>
var gulpFaker = map(function(code, filename) {
return faker.fake(code.toString());
});
gulp.src(['html/*.html'])
.pipe($.plumber())
.pipe($.fileInclude())
.pipe(gulpFaker)
.pipe(gulp.dest('.'));
<div class="news-center-articles">
<ul>
@@include('./partials/article-thumb.html')
@@include('./partials/article-thumb.html')
@@include('./partials/article-thumb.html')
@@include('./partials/article-thumb.html')
@@include('./partials/article-thumb.html')
@@include('./partials/article-thumb.html')
</ul>
<a class="news-center-read-more" href="#">Read More</a>