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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Paulo Ancheta
December 06, 2016
Programming
1
140
Ruby Scripts To Make Life Easier
Introduction to subprocesses and how to use them for everyday use.
Paulo Ancheta
December 06, 2016
Tweet
Share
More Decks by Paulo Ancheta
See All by Paulo Ancheta
Demystifying Git
pauloancheta
0
55
A PR Has Been Submitted
pauloancheta
0
57
Other Decks in Programming
See All in Programming
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
470
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
400
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.7k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.9k
AI活用のコスパを最大化する方法
ochtum
0
130
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.8k
CSC307 Lecture 13
javiergs
PRO
0
320
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
290
SourceGeneratorのマーカー属性問題について
htkym
0
180
CSC307 Lecture 12
javiergs
PRO
0
470
ロボットのための工場に灯りは要らない
watany
7
2.1k
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
300
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
440
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
670
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
The Limits of Empathy - UXLibs8
cassininazir
1
250
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