Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul dagda1

View GitHub Profile
View gist:419704
function scrollToTop() {
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
View gist:471396
task "Teach and Test Notification":
clients:
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 = LeadCapturer::Parser.new(File.read("email.html"))
end
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","http://schemas.microsoft.com/exchange/companies","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","http://schemas.microsoft.com/exchange/extensionattribute1","http://schemas.microsoft.com/exchange/extensionattribute2","http://schemas.microsoft.com/exchange/extensionattribute3","http://schemas.microsoft.com/exchange/extensionattribute4","urn:schemas:contacts:facsimiletelephonenumber","urn:schemas:calen
View Jruby RVM textmate error
/Volumes/TextMate 1.5.9/TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:169:in `run': JRuby only supports F_SETFL and F_GETFL with NONBLOCK for fcntl/ioctl (NotImplementedError) from
/Volumes/TextMate 1.5.9/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:211:in
`parse_version' from /Volumes/TextMate
1.5.9/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:98:in `run' from
/Volumes/TextMate
1.5.9/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/run_script.rb:93
View factory.rb
Factory.define :user do |user|
user.email {"paul.cowan@hotmail.com"}
user.password {"paulcowan"}
user.password_confirmation {"paulcowan"}
user.association(:role)
end
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;
[HttpGet]
[CatchException(false)]
public ViewResult All()
{
var audits = _commonDao.GetAll<Audit>(new[] { "CreatedOn" });
@dagda1
dagda1 / autoprop_init.rb
Created Oct 21, 2010
autoproperty_init.rb
View autoprop_init.rb
class Class
def attr_initializer(*attributes)
attr_reader *attributes
class_eval <<-RUBY
def initialize(#{attributes.join(', ')})
#{attributes.map{ |attribute| "@#{attribute}" }.join(', ')} = #{attributes.join(', ')}
end
RUBY
end
end
@dagda1
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.