Skip to content

Instantly share code, notes, and snippets.

Chris Duell duellsy

Block or report user

Report or block duellsy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GitVersion.php
<?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 Aug 26, 2015
Using Rollbar in Laravel
View Handler.php
// 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(),
@duellsy
duellsy / elevio-segment.md
Created Jun 2, 2015
Docs for elevio on segment
View elevio-segment.md

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 / import.py
Last active Oct 2, 2019 — forked from kbl/import.py
Import tasks and notes from wunderlist dump to todoist (and mark completed tasks as completed)
View import.py
# -*- coding: utf8 -*-
import json
import urllib2
import urllib
import sys
import os
from argparse import ArgumentParser
from collections import defaultdict
@duellsy
duellsy / artisan.php
Last active Jun 8, 2016
Confirming laravel artisan commands when in production, very raw at this stage, but works well.
View artisan.php
<?php
// Adding this to your app/artisan.php file will
// do a quick confirmation that you really do want
// to run this command when in production environment
if (App::environment() === 'production') {
echo "\033[0;33m======== WARNING ========\n";
echo "===== IN PRODUCTION =====\n";
echo "=========================\n";
@duellsy
duellsy / gulpfile.js
Created Feb 20, 2014
Laravel auto testing gulp
View gulpfile.js
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 / gist:6315260
Created Aug 23, 2013
Load all changes for a particular model field with Revisionable
View gist:6315260
$all_ever = \VentureCraft\Revisionable\Revision::where('revisionable_type', 'post')
->where('key', 'blog_title')
->orderBy('id', 'asc')
->get();
@duellsy
duellsy / BaseController.php
Created Aug 23, 2013
Displaying multiple revisions
View BaseController.php
<?php
class BaseController extends Controller
{
/**
* Setup the layout used by the controller.
*
* @return void
*/
View unlock_delete.js
$('.unlock-btn').live('click', function(){
$(this).closest('.btn-group').find('.btn-danger').toggleClass('disabled');
$(this).find('i').toggleClass('icon-lock').toggleClass('icon-unlock');
});
@duellsy
duellsy / view.blade.php
Last active Dec 17, 2015
Check that a section has content in a laravel view, so you can determine if you want to display certain wrapping content etc
View view.blade.php
@if($__env->yieldContent('messages') != '')
<div class="messages">
<h1>Messages</h1>
@yield('messages')
</div>
@endif
You can’t perform that action at this time.