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
540
4
Share
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
83
JSol'Ex : traitement d'images solaires en Java
melix
0
250
JSol'Ex : solar image processing in Java
melix
0
730
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
240
Micronaut Test Resources
melix
1
310
Micronaut Test Resources
melix
1
480
AlpesJUG: Micronaut Test Resources
melix
0
150
Micronaut_Test_Resources.pdf
melix
0
250
Consommation électrique du foyer
melix
0
310
Other Decks in Programming
See All in Programming
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
220
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
370
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
150
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
560
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
390
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
840
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
130
How Swift's Type System Guides AI Agents
koher
0
290
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
980
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
エンジニアに許された特別な時間の終わり
watany
106
240k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Designing Experiences People Love
moore
143
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.2k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
The Curse of the Amulet
leimatthew05
1
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
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