Skip to content

Instantly share code, notes, and snippets.

View virtualdogbert's full-sized avatar
:electron:
Groovy

Tucker Pelletier virtualdogbert

:electron:
Groovy
View GitHub Profile
package com.security.enforcer
import grails.plugin.springsecurity.SpringSecurityService as SpringSecurityService
import org.springframework.beans.factory.annotation.Autowired as Autowired
import com.security.Sprocket as Sprocket
import grails.gorm.transactions.Transactional as Transactional
import com.virtualdogbert.ast.*
@com.virtualdogbert.ast.EnforcerTransactional
public class com.security.enforcer.EnforcerTestTService extends java.lang.Object {
package com.security.enforcer
import com.security.Sprocket
import com.virtualdogbert.ast.*
import grails.gorm.transactions.Transactional
import grails.plugin.springsecurity.SpringSecurityService
@EnforcerTransactional
class EnforcerTestTService {
SpringSecurityService springSecurityService
@virtualdogbert
virtualdogbert / fizzBuzz.groovy
Created September 7, 2013 21:46
This fizzbuzz example, is for my YouTube show SE GEEK: www.youtube.com/user/virtualdogbert
//Fizz Buzz in 62 characters vs http://rosettacode.org/wiki/FizzBuzz#Java
(1..100).each{println"${it%3?'':'Fizz'}${it%5?'':'Buzz'}"?:it}
@virtualdogbert
virtualdogbert / DealCards,groovy
Last active December 22, 2015 13:28
This is for my SE GEEK video tutorials on YouTube: www.youtube.com/channel/UCHRADKRXZkPB6QVee0Q3GSQ
/*
* A link to the SE GEEK video tutorial that references this code:
* http://www.youtube.com/watch?v=U07O3IsRvDI&feature=share&list=SPzerMl1XZ0X1KwRPzJwXMCUjtuzX2KkGr
*
* This is an expressive example of what you can do with groovy to get similar functionality to a post I saw in Java, which
* builds a deck and deals it out:
* http://www.nobigo.com/design-a-deck-of-playing-cards-deck-shuffling/#.UiuCbFGkiP-
*
* Now I know this design is not really reusable, but with some minor changes you can get it there, and still have few lines of
* code than the java example
@virtualdogbert
virtualdogbert / git-p4
Created December 6, 2010 19:19
This is the same modifications I made to the windows version of git-p4 for linux
#!/usr/bin/env python
#
# git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
#
# Author: Simon Hausmann <simon@lst.de>
# Copyright: 2007 Simon Hausmann <simon@lst.de>
# 2007 Trolltech ASA
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#
@virtualdogbert
virtualdogbert / git-p4
Created October 18, 2010 15:33 — forked from glebd/git-p4
This is my fork hacking glebds git-p4 with some new optional features that I found useful.
#!/usr/bin/env python
#
# git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
#
# Author: Simon Hausmann <simon@lst.de>
# Copyright: 2007 Simon Hausmann <simon@lst.de>
# 2007 Trolltech ASA
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#