Skip to content

Instantly share code, notes, and snippets.

View duellsy's full-sized avatar

Chris Duell duellsy

View GitHub Profile
@duellsy
duellsy / counted_tag_release_summary.html
Created August 11, 2020 01:49
Counted tag style release summary
<div class="md:mb-20 md:rounded overflow-hidden bg-white shadow-md text-grey-darkest">
{{#if featured_image}}
<a href="{{ link }}" class="hidden md:block"><img src="{{ featured_image }}" alt="{{ title }}" class="w-full" /></a>
{{/if}}
<div class="md:p-24 p-8">
<span class="no-underline text-grey text-sm" title="{{ release.released_at }}">{{ released_at_human }}</span>
<h2 class="mb-4 font-serif"><a href="{{ link }}" class="no-underline text-grey-darkest"><span class="capitalize release-{{ type }}">{{ type }}:</span> {{ title }}</a></h2>
{{#each tags}}
@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(),
@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 / import.py
Last active October 2, 2019 12:58 — forked from kbl/import.py
Import tasks and notes from wunderlist dump to todoist (and mark completed tasks as completed)
# -*- 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 June 8, 2016 08:18
Confirming laravel artisan commands when in production, very raw at this stage, but works well.
<?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 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 / gist:6315260
Created August 23, 2013 03:27
Load all changes for a particular model field with Revisionable
$all_ever = \VentureCraft\Revisionable\Revision::where('revisionable_type', 'post')
->where('key', 'blog_title')
->orderBy('id', 'asc')
->get();
@duellsy
duellsy / BaseController.php
Created August 23, 2013 03:19
Displaying multiple revisions
<?php
class BaseController extends Controller
{
/**
* Setup the layout used by the controller.
*
* @return void
*/
$('.unlock-btn').live('click', function(){
$(this).closest('.btn-group').find('.btn-danger').toggleClass('disabled');
$(this).find('i').toggleClass('icon-lock').toggleClass('icon-unlock');
});