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
Ruby Scripts To Make Life Easier
Search
Paulo Ancheta
December 06, 2016
Programming
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby Scripts To Make Life Easier
Introduction to subprocesses and how to use them for everyday use.
Paulo Ancheta
December 06, 2016
More Decks by Paulo Ancheta
See All by Paulo Ancheta
Demystifying Git
pauloancheta
0
61
A PR Has Been Submitted
pauloancheta
0
60
Other Decks in Programming
See All in Programming
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
320
ふつうのFeature Flag実践入門
irof
7
3.6k
AIとRubyの静的型付け
ukin0k0
0
540
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
120
AIで効率化できた業務・日常
ochtum
0
110
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
450
さぁV100、メモリをお食べ・・・
nilpe
0
130
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
4.7k
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.5k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
110
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
220
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
140
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Building Applications with DynamoDB
mza
96
7.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
380
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Producing Creativity
orderedlist
PRO
348
40k
Crafting Experiences
bethany
1
170
Abbi's Birthday
coloredviolet
2
8k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
The Spectacular Lies of Maps
axbom
PRO
1
790
Transcript
Ruby Scripts to Make Life Easier #MakeRubyGreatAgain
@PauloAncheta
We make alias-es all the time. We should make something
more useful.
# talk.rb system “echo hello world” $ ruby talk.rb hello
world
# talk* #! bin/env ruby `echo hello world` $ mv
talk.rb talk $ chmod u+x talk $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string}` $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string.gsub(/world/, “VanRuby”) } | grep file.txt` $ ./talk | more file.txt hello VanRuby
$ irb irb(main):001:0> files = `ls` => “Applications\nDesktop\nDocuments\nDow nloads\nLibrary\nMovies\nMusic\nPictur es\nPublic\ntalk\n”
irb(main):002:0> files.class => String
irb(main):003:0> system `ls` => true
All of that is great. How can I be productive
doe?
# clean-pg* #! bin/env ruby pg = `ps aux |
grep postgres | grep waiting` pg = pg.split(/\n/) pg.each do |waiting| # ... some process to get the pid `kill #{pid}` end
# split-branch* #! bin/env ruby # commits => 1z2y3 TICKET-number
msg specific_commits = `git log - -pretty - -oneline | grep #{ARGV}` `git checkout master && git pull origin master && git checkout -b test-branch` specific_commits.each do |commit| sha = commit[0..6] # => [123asdf, qwer456, … ] `git cherry-pick #{sha}` end
#MakeRubyGreatAgain