Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
520
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
60
JSol'Ex : traitement d'images solaires en Java
melix
0
230
JSol'Ex : solar image processing in Java
melix
0
690
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
220
Micronaut Test Resources
melix
1
290
Micronaut Test Resources
melix
1
460
AlpesJUG: Micronaut Test Resources
melix
0
130
Micronaut_Test_Resources.pdf
melix
0
230
Consommation électrique du foyer
melix
0
290
Other Decks in Programming
See All in Programming
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
150
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.3k
CSC307 Lecture 01
javiergs
PRO
0
670
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
650
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
180
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
0
230
AtCoder Conference 2025
shindannin
0
920
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1k
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
310
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
220
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
620
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
530
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
76
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
35
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Design in an AI World
tapps
0
120
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
46
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
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