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 / 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 / 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
*/
@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();
$('.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 December 17, 2015 09:58
Check that a section has content in a laravel view, so you can determine if you want to display certain wrapping content etc
@if($__env->yieldContent('messages') != '')
<div class="messages">
<h1>Messages</h1>
@yield('messages')
</div>
@endif
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <lnolte@i.biz>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@duellsy
duellsy / custom sort.php
Created June 16, 2011 00:38
custom sort
function sortbydate($a,$b){
if($a['date']>$b['date'])
return 1;
else if($a['date']<$b['date'])
return -1;
return 0;
}
@duellsy
duellsy / Box shadow.css
Created June 16, 2011 00:37
Box shadow
-moz-box-shadow: 0 1px 3px black;
-webkit-box-shadow: 0 1px 3px black;
box-shadow: 0 1px 3px black;