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
560
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Human Talks: N'ayez pas peur de faire du Groovy
Slides du lightning talk donné à HumanTalks Nantes.
Cédric Champeau
November 18, 2014
More Decks by Cédric Champeau
See All by Cédric Champeau
Integrating Python and Java easily using (Micronaut) GraalPy
melix
0
99
JSol'Ex : traitement d'images solaires en Java
melix
0
280
JSol'Ex : solar image processing in Java
melix
0
910
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
260
Micronaut Test Resources
melix
1
320
Micronaut Test Resources
melix
1
490
AlpesJUG: Micronaut Test Resources
melix
0
170
Micronaut_Test_Resources.pdf
melix
0
270
Consommation électrique du foyer
melix
0
320
Other Decks in Programming
See All in Programming
Deep dive into the select statement (GopherCon UK)
jespino
0
150
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3.1k
業務時間外もAIに働いてもらう話
colorful12
2
8.2k
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
260
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
27
17k
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.8k
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
230
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
Introducing Stack Pull Request in GitHub
kkamegawa
0
110
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
110
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
290
Raft: Consensus for Rubyists
vanstee
141
7.7k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
630
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
560
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
220
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
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