Skip to content

Instantly share code, notes, and snippets.

View iolson's full-sized avatar

Ian Olson iolson

  • Grubhub
  • Chicago, IL
View GitHub Profile
@freekmurze
freekmurze / Spark helper functions.php
Last active May 3, 2016 16:31
Spark helper functions
<?php
/**
* @return \App\User|null
*/
function currentUser()
{
return request()->user();
}
@sumpygump
sumpygump / maybe-git
Created February 26, 2016 20:10
Maybe Git
#!/bin/bash
# Maybe Git
# INSTALLATION
# 1. Move this file into your ~/bin directory
# mv ./maybe-git ~/bin
# 2. Then run the following command:
# alias git='~/bin/maybe-git'
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active February 24, 2024 13:40
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@rubemlrm
rubemlrm / gist:63cd8eb7e9ba10b4319d
Created September 16, 2015 11:39
Gitlab-ci.yml
before_script:
- composer install --prefer-dist > /dev/null
- export APP_ENV=testing
unitTesting:
script:
- echo "Running PHP Unit tet"
- php vendor/bin/phpunit --colors --debug --coverage-text
codeSniffer:
script:
@hackel
hackel / SentryAuthAdapter.php
Last active June 24, 2021 14:48
SentryAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentry
<?php namespace MyApp\Providers;
use Exception;
use Cartalyst\Sentry\Sentry;
use Cartalyst\Sentry\Users\UserInterface;
use Tymon\JWTAuth\Providers\Auth\AuthInterface;
class SentryAuthAdapter implements AuthInterface
{
/**
@kenzie
kenzie / craft.conf
Last active May 17, 2018 17:48
Nginx virtual host configuration for Craft CMS, PHP5-FPM, NGINX 1.2.1 and craft/config/general.php for friendly URLs.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
@bmarston
bmarston / InitialDbMigrationCommand.php
Created May 8, 2013 16:23
Let's say you're starting a new Yii project and you've already created the database schema for it using something like phpMyAdmin or MySQL Workbench. Now you want to create an initial database migration so you can put the schema under version control, but you don't want to manually write the Yii code to create the tables, indexes, and foreign ke…
<?php
class InitialDbMigrationCommand extends CConsoleCommand
{
public function run($args) {
$schema = $args[0];
$tables = Yii::app()->db->schema->getTables($schema);
$addForeignKeys = '';
$dropForeignKeys = '';