Skip to content

Instantly share code, notes, and snippets.

@anthonyshort
anthonyshort / grunt.js
Created September 28, 2012 07:00
My Gruntfile
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! Cake Marketing - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://cakemarketing.com/\n' +
@anthonyshort
anthonyshort / BaseManager.php
Created August 2, 2012 01:39
Entity Manager
public $filters = array(
'assignee' => function($qb,$assignee_id){
if($assignee_id === 'none') {
$this->repository->filterByUnassigned($qb);
}
elseif($assignee_id) {
$this->repository->filterByAssignee($qb,$assignee_id);
}
},
'status' => function($qb,$status){
@anthonyshort
anthonyshort / gist:3195891
Created July 29, 2012 03:06
Bash Profile
export PATH=/usr/local/bin:$PATH
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
export PATH=$PATH:~/.gem/ruby/1.8/bin
export PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"
@import "icons/standard/geomicons/dark/*.png";
.icon {
&:before {
@include show-pseudo-element;
position:absolute;
top:50%;
margin-top:-9px;
left:0;
width:16px;
@anthonyshort
anthonyshort / _colours.scss
Created July 10, 2012 01:50
Colours with Sass
// Base Colours
$text-color :#d7d7d9 #a4acb2 #495a66 #979da2 #a4acb2;
$background-color :#f2f2f2 #f6f7f7 #495965 #36424a;
$border-color :#34a5e0 #eef0f1 #e3e3e5 #dcdcde;
$accent-color :#FF7070 #39b54a #ee2ea0 #63c0f2 #50b4f0;
// Specific Colours
$highlight-color :nth($accent-color,1);
$selected-color :nth($accent-color,2);
$primary-action-color :nth($accent-color,3);
@anthonyshort
anthonyshort / gist:2872308
Created June 5, 2012 02:59
Backbone Form View
define(function(){
'use strict';
return Backbone.View.extend({
getFields: function(){
return this.$(":input").not(':button, :submit, :reset');
},
parseFormData: function(data){
return data;
},
@anthonyshort
anthonyshort / mq.scss
Created May 29, 2012 00:00
Simple MQ
$breakpoint: "screen and (min-width:200px) and (max-width:400px)";
#id {
@media #{$breakpoint} {
color:red;
}
}
@anthonyshort
anthonyshort / gist:2785334
Created May 25, 2012 01:50
Keyframe Usage
@include keyframes('throbber') {
0% {
}
100% {
}
}
@anthonyshort
anthonyshort / confirm.js
Created April 18, 2012 01:26
Confirmation dialog using Twitter bootstraps modal window and Backbone.Posture
define(function(){
'use strict';
var Confirm = Backbone.Posture.View.extend({
events: {
'click .js-confirm' : '_handleConfirm',
'click .js-cancel' : '_handleCancel'
},
template: Handlebars.templates['ui/confirm'],
@anthonyshort
anthonyshort / backbone.extensions.coffee
Created April 12, 2012 00:08
Some Backbone extensions I've put together based on Chaplin. I wanted to customize some of the 'framework' parts. It's a work in progress. Attaching them to the Backbone object makes them easier to work with across projects that don't use require.js.
'use strict'
# --------------------------------------------------
# EventEmitter
# --------------------------------------------------
emitter = Backbone.EventEmitter = _.extend {}, Backbone.Events
# --------------------------------------------------
# Global subscriptions