Skip to content

Instantly share code, notes, and snippets.

View marcpalmer's full-sized avatar
💭
Busy working on Concepts app, and Captionista

Marc Palmer marcpalmer

💭
Busy working on Concepts app, and Captionista
View GitHub Profile
@marcpalmer
marcpalmer / gist:1183594
Created August 31, 2011 13:59
Navigation API thoughts

Navigation API

Site navigation is a combination of two concerns - declaring what navigation items there are in the site, and what the structure of them is - as presented to the use.

Specifying items and structure separately is not DRY, and applications also need to have the ability to change the structure to suit them - therefore the structure information provided by a plugin is merely a guide, and inherently disposable.

@marcpalmer
marcpalmer / gist:1195658
Created September 5, 2011 18:50
Integration test output with debug console logging in 2.0
marcmacbook:resources marc$ grails test-app :integration
| Environment set to test.....
> You currently already have a version of the plugin installed [tomcat-2.0.0.BUILD-SNAPSHOT]. Do you want to update to [tomcat-1.3.7]? [y,n] n
| Plugin tomcat-1.3.7 install aborted
> You currently already have a version of the plugin installed [hibernate-2.0.0.BUILD-SNAPSHOT]. Do you want to update to [hibernate-1.3.7]? [y,n] n
| Packaging Grails application.....
2011-09-05 19:47:01,898 [main] INFO plugins.DefaultGrailsPluginManager - Attempting to load [0] user defined plugins
2011-09-05 19:47:01,971 [main] INFO plugins.DefaultGrailsPluginManager - Grails plug-in [logging] with version [2.0.0.BUILD-SNAPSHOT] loaded successfully
2011-09-05 19:47:01,971 [main] INFO plugins.DefaultGrailsPluginManager - Grails plug-in [i18n] with version [2.0.0.BUILD-SNAPSHOT] loaded successfully
2011-09-05 19:47:01,971 [main] INFO plugins.DefaultGrailsPluginManager - Grails plug-in [core] with version [2.0.0.BUILD-SNAPSHOT] loaded su
@marcpalmer
marcpalmer / gist:1195788
Created September 5, 2011 19:57
Weceem data feed example
<g:set var="feedURL" value="http://feeds.bbci.co.uk/news/rss.xml"/>
<g:set var="feedData"
value="${new URL(feedURL).text}"/>
<g:set var="feedDOM"
value="${new XmlSlurper().parseText(feedData)}"/>
<h2>News</h2>
<ul>
<g:each in="${feedDOM.channel.item[0..4]}" var="item">
<li>
@marcpalmer
marcpalmer / gist:1195792
Created September 5, 2011 19:59
Cache headers plugin example
withCacheHeaders {
etag {
"${content.ident()}:${content.version}".encodeAsSHA1()
}
lastModified {
(content.changedOn ?: content.createdOn)
}
generate {
def activeUser = wcmSecurityService.userName
@marcpalmer
marcpalmer / resources_article_1_snippet_1.groovy
Created September 12, 2011 15:11
Resources Article 1 snippet 1
modules = {
common {
resource url:"css/main.css"
resource url:"js/jquery.js"
}
}
@marcpalmer
marcpalmer / resources_article_1_snippet_2.gsp
Created September 12, 2011 15:16
Resources Article 1 snippet 2
<html>
<head>
<g:layoutHead/>
<r:layoutResources/>
</head>
<body>
<div id="content">
<g:layoutBody/>
</div>
<r:layoutResources/>
@marcpalmer
marcpalmer / resources_article_1_snippet_3.gsp
Created September 12, 2011 15:28
Resources Article 1 snippet 3
<html>
<head>
<g:layoutHead/>
<r:layoutResources/>
</head>
<body>
<div id="content">
<g:layoutBody/>
</div>
<r:layoutResources/>
@marcpalmer
marcpalmer / resources_article_1_snippet_3.gsp
Created September 12, 2011 15:29
Resources Article 1 snippet 3
<html>
<head>
<g:layoutHead/>
<r:layoutResources/>
</head>
<body>
<div id="content">
<g:layoutBody/>
</div>
<r:layoutResources/>
@marcpalmer
marcpalmer / resources_article_1_snippet_4.gsp
Created September 12, 2011 15:30
Resources Article 1 snippet 4
<html>
<head>
<meta name="layout" content="main"/>
<r:require module="common"/>
</head>
<body>
</body>
</html>
@marcpalmer
marcpalmer / resources_article_1_snippet_5.groovy
Created September 12, 2011 15:32
Resources Article 1 snippet 5
modules = {
common {
resource url:'css/main.css'
resource url:'js/jquery.js', disposition:'head'
}
}