Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @file
* Date forms and form themes and validation.
*
* All code used in form editing and processing is in this file,
* included only during form editing.
*/
/**

This is a test.

  • test
  • test
@donut
donut / 0-Instructions.markdown
Last active August 29, 2015 14:04
How to get Compass like sprites with Stylus and SVG

Using the grunt-dr-svg-sprites GruntJS plugin and a custom Handlebars template (below) I was able to get the basic functionality that Compass provides for PNG sprites but for SVGs.

Note that the below template is not generalized and will not work for all dr-svg-sprites configurations. It works for my setup and would probably be a good base for others.

I've included the relevant portions of my Gruntfile as well.

@donut
donut / CaptainHook.coffee
Last active August 29, 2015 14:05
A simple hook system in JavaScript.
###*
* @file
* A hook system.
* @see https://gist.github.com/donut/f16040209cdc6f5e62c2
###
'use strict'
hook =
_callbacks: []
###*
* @file
* Provides mixin support for classes.
* @url https://gist.github.com/donut/00e407abb7cece0bcdfa
* @see http://coffeescriptcookbook.com/chapters/classes_and_objects/mixins
###
module.exports = (base, mixins...) ->
constructors = []
###*
* @file
* Provides support for classes to have event systems.
* @url https://gist.github.com/donut/e4268b600bf72a8290e8
###
class EventsMixin
constructor: ->
@_event_handlers = {}
<?php
/**
* sfGuardUserProfile form.
*
* @package form
* @subpackage sfGuardUserProfile
* @version SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
*/
class sfGuardUserProfileForm extends BasesfGuardUserProfileForm
# All id type columns are set to integer with a length of 4 since this forces Doctrine to use integer type instead of bigint. This is especially important for working with sfGuardUserPlugin.
sfGuardUserProfile:
actAs: { Timestampable: ~ }
columns:
id: { type: integer(4), primary: true, autoincrement: true }
user_id: integer(4)
first_name: varchar(50)
last_name: varchar(50)
email: varchar(100)
phone: varchar(25)
<?php
/**
* sfGuardUser form.
*
* @package form
* @subpackage sfGuardUser
* @version SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
*/
class sfGuardUserForm extends PluginsfGuardUserForm
@donut
donut / gist:68582
Created February 22, 2009 19:44 — forked from anonymous/gist:68581
<!-- start content -->
<div id="content_confess">
{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="15" disable="member_data|trackbacks"}
<div class="post">
<h2 class="title">{title}</h2>
<div class="entry">
<p>{name}</p>
<p>{body_content}</p>
<p>&nbsp;</p>
</div><!--.entry-->