Skip to content

Instantly share code, notes, and snippets.

View mdunbavan's full-sized avatar

Mark Dunbavan mdunbavan

View GitHub Profile
@sineld
sineld / laravel-upload-resize.php
Created September 25, 2012 08:11
Laravel File Upload And Resize
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@katzueno
katzueno / global_nav.php
Created May 30, 2015 04:21
Sakan テーマのグローバルナビで、英語判定を行うチェックを追加。英語だったら、ハンドルを表示しない。
<?php defined('C5_EXECUTE') or die("Access Denied.");
$nh = Core::make('helper/navigation');
$th = Core::make('helper/text');
$trail = $nh->getTrailToCollection($c);
$isRoot = null;
if (is_array($trail) && count($trail) > 1) {
$count = count($trail);
array_splice($trail, $count - 1);
$topC = array_pop($trail);
@hatefulcrawdad
hatefulcrawdad / SassMeister-input.scss
Last active December 16, 2015 17:46
Topic Color Idea
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// Bourbon (v4.2.3)
// ----
@import "bourbon/bourbon";
$topics: (
html: #39ADD1,
@dannyockilson
dannyockilson / gist:52a444195f0df873cc1c
Created March 13, 2015 17:11
Simple Angular Service for WordPress
'use strict';
angular.module('wordpress', [])
.service( 'wpService',
function($http, $q){
var url = 'http://allin.local/wp-json/';
return({
@appkr
appkr / .bowerrc
Last active April 5, 2016 06:59
Laravel 5 Front-end Scaffolding
{
"analytics": false,
"directory": "resources/assets/vendor"
}
@wmbenedetto
wmbenedetto / css3BackgroundAnimation.html
Last active April 12, 2016 12:58
Animating a background gradient with CSS3 to mimic the iPhone's slide-to-unlock screen
<html>
<head>
<title>CSS3 Slide to unlock</title>
<style type="text/css">
body {
background:#333;
}
.slider-text {
<form method="post" action="" id="login-form" accept-charset="UTF-8">
<input type="hidden" name="action" value="users/login">
<input type="hidden" name="redirect" value="{{redirect}}">
<div class="form-group">
<label for="email">Email</label>
<input id="email" type="text" name="loginName" class="form-control">
</div>
@garyconstable
garyconstable / TestPlugin.php
Last active December 29, 2016 11:11
Craft CMS Loop through categories and children from within a plugin
<?php
namespace Craft;
class TestPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Test Plugin');
}
@mhgbrown
mhgbrown / newsletter.js
Created February 21, 2017 17:31
AJAX Submission of Mailchimp Form with Internationalization; Uses jQuery
var SUCCESS_MESSAGES = {
'en': {
'complete the subscription': 'Confirm the subscription in your inbox',
'default': 'Confirm the subscription in your inbox'
},
'de': {
'complete the subscription': 'Bestätigen Sie das Abonnement in Ihrer Inbox',
'default': 'Bestätigen Sie das Abonnement in Ihrer Inbox'
}
}
#!/bin/bash
#
# Some SASS helpers
#
# INSTALL:
#
# * save the sassbash file somewhere
# * chmod +x it to make it executable
# * add path to script in your .bashrc
# * . /path/to/sassbash