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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Cédric Champeau
November 18, 2014
Programming
550
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
87
JSol'Ex : traitement d'images solaires en Java
melix
0
260
JSol'Ex : solar image processing in Java
melix
0
790
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
250
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
260
Consommation électrique du foyer
melix
0
310
Other Decks in Programming
See All in Programming
AIとRubyの静的型付け
ukin0k0
0
540
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
150
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
770
Swiftのレキシカルスコープ管理
kntkymt
0
220
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
230
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
160
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
620
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
220
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
420
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
180
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
200
Producing Creativity
orderedlist
PRO
348
40k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
It's Worth the Effort
3n
188
29k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
820
Agile that works and the tools we love
rasmusluckow
331
21k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Speed Design
sergeychernyshev
33
1.8k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
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