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
130
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
39
A PR Has Been Submitted
pauloancheta
0
50
Other Decks in Programming
See All in Programming
Lambda(Python)の リファクタリングが好きなんです
komakichi
3
180
ミリしらMCP勉強会
watany
4
750
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.3k
Java 24まとめ / Java 24 summary
kishida
3
500
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
620
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
980
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.7k
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Webinar 2025
danielsogl
0
120
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
160
Unlock the Potential of Swift Code Generation
rockname
0
250
国漢文混用体からHolloまで
minhee
1
180
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
260
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Into the Great Unknown - MozCon
thekraken
37
1.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Done Done
chrislema
183
16k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Gamification - CAS2011
davidbonilla
81
5.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Documentation Writing (for coders)
carmenintech
69
4.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Bash Introduction
62gerente
611
210k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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