Skip to content

Instantly share code, notes, and snippets.

@rdmueller
rdmueller / gist:6211786
Created August 12, 2013 15:19
oAuth2 as Grails Controller
import grails.converters.JSON
class AuthController {
def login = {
//let's fetch everything which depends on the provider from the config
def config = grailsApplication.config.oauth.providers[params.provider]
def appKey = config.appKey
def secret = config.secret
def scope = config.scope
GRAILS GROOVY SOURCE
3.0.1
3.0.0 2.4 https://grails.github.io/grails-doc/3.0.x/guide/introduction.html
2.5.0 2.4 http://grails.1312388.n4.nabble.com/ANN-Grails-2-4-5-and-Grails-2-5-0-released-td4658938.html
2.4.5
2.4.4
2.4.3
2.4.2
// Copyright 2015
// Licensed under the Apache License, Version 2.0 (the "License")
// original source https://gist.github.com/rdmueller/acee3a5db5ea3273652b
import org.codehaus.groovy.grails.commons.DefaultGrailsDomainClass
import grails.util.GrailsNameUtils
//includeTargets << grailsScript("_Init")
includeTargets << grailsScript("_GrailsPackage")
includeTargets << grailsScript("_GrailsBootstrap")
@rdmueller
rdmueller / fetchGithubIssues.groovy
Created March 28, 2016 21:18
An example on how to fetch all open issues of a repository with groovy.
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.6' )
import groovyx.net.http.RESTClient
import groovyx.net.http.EncoderRegistry
def github = new RESTClient( 'https://api.github.com/' )
github.encoderRegistry = new EncoderRegistry( charset: 'utf-8' )
def headers = [
'Content-Type':'application/json; charset=utf-8',
'User-Agent':'rdmueller' // replace with your github user name
]
// simple script which shows how to read and write YAML with Groovy
@Grab("org.yaml:snakeyaml:1.16")
import org.yaml.snakeyaml.Yaml
def yamlData = """
Time: 2001-11-23 15:01:42 -5
User: a Test
# Multiline String
Warning:
This is an error message
@rdmueller
rdmueller / map2Json.groovy
Last active March 1, 2020 21:35
This Gist demonstrate how to serialize a Map to JSON and YAML with Groovy
//Problem:
//languages like tcl can simply switch between the String representation of a map or list and the
//object itself. In Groovy, this could theoretically work, but it doesn't:
def list1 = [1,2,3]
def list2 = ["1, 2, 3"]
assert list1 != list2
assert list1.toString() == list2.toString()
assert Eval.me(list1.toString()) instanceof List
assert Eval.me(list2.toString()) instanceof List
assert Eval.me(list1.toString()) == Eval.me(list2.toString())
div#test { border: 1px solid red; } div#test dl { } div#test dt { border: 1px solid green; }

this is how you get a good grails starter application with social login up and running

first create a basic app with the web-profile:

grails create-app myStarter
cd myStarter

Keybase proof

I hereby claim:

  • I am rdmueller on github.
  • I am rdmueller (https://keybase.io/rdmueller) on keybase.
  • I have a public key ASAY4wvXpm578bImazg2bLOZarkCW4L2qjpDpTEUNgv_uAo

To claim this, I am signing this object:

Greach 2019 awesome list

What is this?

A compilation of all the links to slides and repositories used in workshops or shown by the speakers.

Why

It can be difficult to retrieve all that material on twitter after the conference.

Contents