Skip to content

Instantly share code, notes, and snippets.

View dcsg's full-sized avatar
🏠
Working from home

Daniel Gomes dcsg

🏠
Working from home
View GitHub Profile
@winzou
winzou / AmountModel.php
Created July 21, 2011 02:36
Subform Validation
<?php
namespace Asso\BookBundle\Form;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContext;
/**
* @Annotation
*/
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);