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
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
52
A PR Has Been Submitted
pauloancheta
0
57
Other Decks in Programming
See All in Programming
CSC307 Lecture 03
javiergs
PRO
1
460
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
430
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
470
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
220
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
0
1.3k
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
930
Grafana:建立系統全知視角的捷徑
blueswen
0
270
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.3k
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
700
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
300
これならできる!個人開発のすゝめ
tinykitten
PRO
0
140
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.3k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
130
Raft: Consensus for Rubyists
vanstee
141
7.3k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Embracing the Ebb and Flow
colly
88
4.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
690
Deep Space Network (abreviated)
tonyrice
0
33
Amusing Abliteration
ianozsvald
0
82
Designing for humans not robots
tammielis
254
26k
Heart Work Chapter 1 - Part 1
lfama
PRO
4
35k
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