Skip to content

Instantly share code, notes, and snippets.

View duellsy's full-sized avatar

Chris Duell duellsy

View GitHub Profile
@duellsy
duellsy / method 404 catch
Created February 17, 2011 01:38
Send user to 404 page if controller exists but method does not (add to MY_Controller.php)
function _remap($method) {
if (in_array(strtolower($method), array_map('strtolower', get_class_methods($this)))) {
$uri = $this->uri->segment_array();
unset($uri[1]);
unset($uri[2]);
call_user_func_array(array($this, $method), $uri);
}
else {
redirect('404');
@duellsy
duellsy / elevio-segment.md
Created June 2, 2015 22:52
Docs for elevio on segment

Getting Started

Once you have Segment installed on your site, toggle elevio from your Segment integrations page, and add your account ID which you can find on your elevio widget settings page.

elevio supports the identify method to provide extra user information.


Identify

@duellsy
duellsy / gulpfile.js
Created February 20, 2014 23:52
Laravel auto testing gulp
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifycss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var phpunit = require('gulp-phpunit');
var notify = require('gulp-notify');
var gutil = require('gulp-util');
var exec = require('child_process').exec;
var sys = require('sys');
var livereload = require('gulp-livereload');
@duellsy
duellsy / GitVersion.php
Created August 26, 2015 23:44
Git hash creator
<?php namespace Elevio\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class GitVersion extends Command
{
/**
* The console command name.
@duellsy
duellsy / Handler.php
Created August 26, 2015 23:36
Using Rollbar in Laravel
// this is in app/Exceptions/Handler.php
// rollbar/rollbar installed via composer
public function report(Exception $e)
{
if (!Config::get('app.debug') && $e->getStatusCode() != '404') {
$conf = [
'access_token' => Config::get('services.rollbar.access_token'),
'environment' => App::environment(),