This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExampleController { | |
| def splitTestService | |
| def almostConverted() { | |
| // Mark split test as converting on Action 1 | |
| splitTestService.markTestAsActionOneConverted('My First Split Test') | |
| // Mark split test as converting on Action 2 | |
| splitTestService.markTestAsActionTwoConverted('My First Split Test') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.example.Role | |
| import com.example.User | |
| class BootStrap { | |
| def shiroSecurityService | |
| def init = { servletContext -> | |
| // Create the admin role | |
| def adminRole = Role.findByName('ROLE_ADMIN') ?: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.groovyflow | |
| import org.springframework.web.servlet.support.RequestContextUtils | |
| class FoundationTagLib { | |
| static namespace = "foundation" | |
| Closure paginate = { attrs -> | |
| def writer = out | |
| if (attrs.total == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| runtime 'postgresql:postgresql:9.1-901-1.jdbc4' | |
| } | |
| plugins { | |
| runtime ":hibernate:$grailsVersion", | |
| ":jquery:1.7.1", | |
| ":resources:1.1.6", | |
| ":spring-security-core:1.2.7.3", | |
| ":taggable:1.0.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <snippet> | |
| <content><![CDATA[ | |
| <table> | |
| <thead> | |
| <tr> | |
| <th>${1:}</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> x = 1 # Assigns the variable x with the value of 1 | |
| => 1 | |
| >> y = 2 # Assigns the variable y with the value of 2 | |
| => 2 | |
| >> z = x + y # Assigns the sum of x and y to the variable z | |
| => 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> first_name = "Eric" | |
| => "Eric" | |
| >> last_name = 'Berry' | |
| => "Berry" | |
| >> first_name + " " + last_name | |
| => "Eric Berry" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> cost_per_taco = 0.85 | |
| => 0.85 | |
| >> taco_count = 3 | |
| => 3 | |
| >> total_cost = cost_per_taco * taco_count | |
| => 2.55 | |
| >> cost_per_taco.class | |
| => Float | |
| >> taco_count.class | |
| => Fixnum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> x = true | |
| => true | |
| >> y = false | |
| => false | |
| >> x == y # is x equal to y? This is what the == operand does | |
| => false | |
| >> eric_age = 35 | |
| => 35 | |
| >> josh_age = "35" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> hand = [ 'Ace', 'Jack', 'Queen', 'King' ] | |
| => ["Ace", "Jack", "Queen", "King"] | |
| >> hand.class | |
| => Array | |
| >> hand[2] # return the value at the 2nd index (3rd item) | |
| => "Queen" |