Skip to content

Instantly share code, notes, and snippets.

Paul dagda1

Block or report user

Report or block dagda1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:419704
function scrollToTop() {
$('html, body').animate({ scrollTop: 0 }, 'slow');
View gist:471396
task "Teach and Test Notification":
include @local
reminder_subject "You have been selected to take the $test test"
reminder_body """You have been selected to sit the $test on the $date<br/><br/>
The test details will be emailed to you on that date."""
subject "Your $test details"
View parser_tests.rb
require File.dirname(__FILE__) + '/../test_helper'
class ParserTests < Test::Unit::TestCase
should_parse_leads "from an html file" do
@parser ="email.html"))
should_parse_leads "with duplicate identifiers" do
@html = <<-eohtml
View gist:591359
<?xml version='1.0' ?><a:searchrequest xmlns:a='DAV:' ><a:sql>SELECT "DAV:id","urn:schemas:contacts:account","urn:schemas:contacts:bday","urn:schemas:contacts:billinginformation","urn:schemas:contacts:businesshomepage","urn:schemas:contacts:c","urn:schemas:contacts:callbackphone","urn:schemas:contacts:children","urn:schemas:contacts:childrensnames","urn:schemas:contacts:cn","urn:schemas:contacts:co","","urn:schemas:contacts:computernetworkname","urn:schemas:contacts:customerid","urn:schemas:contacts:department","urn:schemas:contacts:dn","urn:schemas:contacts:email1","urn:schemas:contacts:email2","urn:schemas:contacts:email3","urn:schemas:contacts:employeenumber","","","","","urn:schemas:contacts:facsimiletelephonenumber","urn:schemas:calen
View Jruby RVM textmate error
/Volumes/TextMate 1.5.9/ `run': JRuby only supports F_SETFL and F_GETFL with NONBLOCK for fcntl/ioctl (NotImplementedError) from
/Volumes/TextMate 1.5.9/
`parse_version' from /Volumes/TextMate
1.5.9/ `run' from
View factory.rb
Factory.define :user do |user| {""}
user.password {"paulcowan"}
user.password_confirmation {"paulcowan"}
View dateFromJson.js
function dateFromJson(json) {
return new Date(parseInt(json.replace(/(^.*\()|([+-].*$)/g, '')));
View aspnetmvc.cs
[BaseSecurityFilter(role: "Admin")]
public class AuditController : BaseController
private readonly dynamic _structureService;
public ViewResult All()
var audits = _commonDao.GetAll<Audit>(new[] { "CreatedOn" });
dagda1 / autoprop_init.rb
Created Oct 21, 2010
View autoprop_init.rb
class Class
def attr_initializer(*attributes)
attr_reader *attributes
class_eval <<-RUBY
def initialize(#{attributes.join(', ')})
#{{ |attribute| "@#{attribute}" }.join(', ')} = #{attributes.join(', ')}
dagda1 / with.hql
Created Oct 27, 2010
extra clause in with
View with.hql
Select q FROM GeneralQuestion
q Left Join q.QuestionResponses as qr with qr.ContactUid = :contactuid
WHERE q.ParentUid = :audituid
You can’t perform that action at this time.