Skip to content

Instantly share code, notes, and snippets.

View bgallagh3r's full-sized avatar

Brian Gallagher bgallagh3r

View GitHub Profile
@bgallagh3r
bgallagh3r / controller.sublime-snippet
Created September 19, 2012 15:36
Laravel Controller - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
<?php
class ${1}s_Controller extends Base_Controller {
/*
|--------------------------------------------------------------------------
| Parent Contstruct
|--------------------------------------------------------------------------
@bgallagh3r
bgallagh3r / gist:3328677
Created August 12, 2012 01:26
Logix Ascii Logo
/*;;.
.;;.
.;;.
.;;. ... ...
.;;. .;;;;;;;; ,;;;;;;;: .. ,;;;;;;, .;;,
.;;. .;;;;....,. :;;;,...:, .;;. :;;,..,;;;. .;;;;
.;;. .;;; :;;: .;;. :;; ,;;;. ;;;;
.;;. ,;; ;;, .;; .;;. ;;;, .,.
.;;. ;;; .;;. .;; .;;. ;;;.
.;;. ;;; :;;. ,;; .;;. :. :;;;.
@bgallagh3r
bgallagh3r / gist:3745158
Created September 18, 2012 19:11
Ascii Meme: Challenge Accepted
.. ..
......... ......
. . ..... . .. . . ... . ...
. ... .=?8nmmmmmmmmmmmnz=,.... ...
.......,=nmd7: . . . . . .=omnz: ..
@bgallagh3r
bgallagh3r / gist:3745139
Created September 18, 2012 19:08
Ascii Meme: Y U NO Guys
ლ(ಠ_ಠლ)
ლ(ಠ益ಠლ)
(ノಠ益ಠ)ノ彡
@bgallagh3r
bgallagh3r / QueryBuilder.php
Created September 11, 2014 22:30
A helper class to build prepared statements using WordPress's WPDB class.
<?php
/**
* A helper class to allow you to easily build prepared statements
* for use with Wordpress's WPDB class.
*
* Usage: $this->orderBy('column', 'asc')->limit(50)->getQuery();
*/
class QueryBuilder {
@bgallagh3r
bgallagh3r / FeatureContext.php
Last active April 8, 2018 01:51
Behat FeatureContext Bootstrap for use in Laravel.
<?php
// Put this inside of your featurecontext class
// This assumes the FeatureContext.php class is within app/tests/behat/features/bootstrap
// Another thing to note... I'm using sqlite in memory for these tests,
// so I'm not worried about the db at the end of the run, just the install and start.
class FeatureContext extends BehatContext //or MinkContext if using Mink
{
@bgallagh3r
bgallagh3r / route.sublime-snippet
Created September 14, 2012 00:10 — forked from JeffreyWay/snippet.xml
Laravel Route Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
/*
|--------------------------------------------------------------------------
| RESTful routes for ${1} controller
|--------------------------------------------------------------------------
|
|
| HTTP VERB | Controller | Description
| GET | ${1}s/ | Get all ${1}s
public function range_add($aVars) {
$aVars[] = "range";
return $aVars;
}
public function range_where( $where, $args ) {
if( !is_admin() ) {
$range = ( isset($args->query_vars['range']) ? $args->query_vars['range'] : false );
if( $range ) {
$range = split(',',$range);
$where .= "AND LEFT(wp_posts.post_title,1) BETWEEN '$range[0]' AND '$range[1]'";
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@bgallagh3r
bgallagh3r / gitutils.ps1
Created September 5, 2012 14:22 — forked from markembling/gitutils.ps1
Powershell functions for git information
# Git functions
# Mark Embling (http://www.markembling.info/)
# Is the current directory a git repository/working copy?
function isCurrentDirectoryGitRepository {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
# Test within parent dirs