Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Human Talks: N'ayez pas peur de faire du Groovy
Search
Cédric Champeau
November 18, 2014
Programming
4
510
Human Talks: N'ayez pas peur de faire du Groovy
Slides du lightning talk donné à HumanTalks Nantes.
Cédric Champeau
November 18, 2014
Tweet
Share
More Decks by Cédric Champeau
See All by Cédric Champeau
Integrating Python and Java easily using (Micronaut) GraalPy
melix
0
54
JSol'Ex : traitement d'images solaires en Java
melix
0
230
JSol'Ex : solar image processing in Java
melix
0
680
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
210
Micronaut Test Resources
melix
1
280
Micronaut Test Resources
melix
1
450
AlpesJUG: Micronaut Test Resources
melix
0
120
Micronaut_Test_Resources.pdf
melix
0
230
Consommation électrique du foyer
melix
0
290
Other Decks in Programming
See All in Programming
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.3k
TestingOsaka6_Ozono
o3
0
170
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
150
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
400
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
860
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
230
AIエージェントの設計で注意するべきポイント6選
har1101
5
1.3k
Developing static sites with Ruby
okuramasafumi
0
310
Cap'n Webについて
yusukebe
0
140
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
380
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.6k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Done Done
chrislema
186
16k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
How to build a perfect <img>
jonoalderson
0
4.6k
Test your architecture with Archunit
thirion
1
2.1k
A Tale of Four Properties
chriscoyier
162
23k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
0
160
エンジニアに許された特別な時間の終わり
watany
105
220k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Transcript
N'ayez pas peur de faire du @CedricChampeau
Made in Nantes
Scripting
log.message "Releasing Groovy $version with user: $user" def desc =
"Release of $version" def date = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ") def remoteCall = { String url, List params, Closure onFailure -> def p = ['curl', "-m", "3600", "-u", "$user:$key", *params, url].execute() int code = p.waitFor() def resp = p.text log.message "${resp}" if (code!=0 || resp.toLowerCase().contains('error') ) { onFailure(code) System.exit(code) } }
DSLs
remoteSession { scp { from { localDir "$buildDir/application " }
into { remoteDir '/usr/local/myapp' } timeout 10.minutes } }
Java friendly
@Immutable @ToString class Person { String name int age String
greet(String them) { "Hello $them, my name is $name" } }
Dynamic
@ToString class Person { String name int age } def
storage = [new Person(name:'Cédric', age:35), new Person(name:'Hugues', age:44)] Person.metaClass.static.methodMissing = { String name, args -> if (name.startsWith('findBy')) { String prop = (name - 'findBy').toLowerCase() storage.findAll { it."$prop" == args[0]} } } println Person.findByAge(35)
Static
@ToString class Person { String name int age } @CompileStatic
void erreurDeCompil() { println Person.findByAge(35) }
Functional
new URL('http://beta.groovy-lang.org').text .split(' ') .findAll { it == 'Groovy' }
.size()
Microservices?
@Grab('com.h2database:h2:1.3.179') import grails.persistence.* @Entity @Resource(uri='books') class Book { String title
}
Builds
apply plugin: 'groovy' repositories { jcenter() } dependencies { compile
'org.codehaus.groovy:groovy:2.3.4-beta-3' }
Android
notify(NOTIFICATION_ID) { smallIcon = R.drawable.ic_action_alarms largeIcon = cachedBitmap contentTitle =
'Time left' contentText = "$timeLeft (Elapsed: ${rounded}%)" contentIntent = pendingActivityIntent(0, intent(WearPresentationActivity), FLAG_UPDATE_CURRENT) ongoing = true style = bigTextStyle { bigText """Time left for your presentation: $timeLeft Elapsed time: ${rounded}%) """ } }
Templating
layout 'layouts/main.groovy', true, pageTitle: 'The Groovy programming language - Mailing-lists',
mainContent: contents { div(id: 'content', class: 'page-1') { div(class: 'row') { div(class: 'row-fluid') { div(class: 'col-lg-3') { include template: 'includes/community-navbar.groovy' } div(class: 'col-lg-8 col-lg-pull-0') { include template: 'includes/contribute-button.groovy' h1 { i(class: 'fa fa-envelope-o') {} yield ' Mailing-lists' } ...
Et tant d'autres...
None
Merci ! @CedricChampeau