sudo apt-get install youtube-dl youtube-dl
youtube-dl -cit http.....(paste the link) youtube-dl http://www.youtube.com/watch?v=_z-hEyVQDRA
You can also specify other options
http://www.tutorialspoint.com/ruby-on-rails/rails-migrations.htm | |
http://railsguides.net/change-data-in-migrations-like-a-boss/ | |
http://makandracards.com/makandra/15575-how-to-write-complex-migrations-in-rails |
irb1(main):029:0> "- dredtrnedtdj - uifsdkghdkjghjh ".split(/- /) | |
=> ["", "dredtrnedtdj ", "uifsdkghdkjghjh "] | |
irb1(main):031:0> "- dredtrnedtdj - fsjfsgdgdgdffff-gdfjdgjdgdg".split(/- /).compact.reject(&:empty?).each {|t| puts "#{t}"} | |
dredtrnedtdj | |
fsjfsgdgdgdffff-gdfjdgjdgdg | |
=> ["dredtrnedtdj ", "uifsdkghdkjghjh ", "fsjfsgdgdgdffff-gdfjdgjdgdg"] | |
irb1(main):032:0> "- dredtrnedtdj - fsjfsgdgdgdffff - gdfjdgjdgdg".split(/- /).compact.reject(&:empty?).each {|t| puts "#{t}"} | |
dredtrnedtdj |
sudo apt-get install youtube-dl youtube-dl
youtube-dl -cit http.....(paste the link) youtube-dl http://www.youtube.com/watch?v=_z-hEyVQDRA
You can also specify other options
http://ruby-doc.org/stdlib-2.1.1/libdoc/optparse/rdoc/OptionParser.html |
https://ruby-hacking-guide.github.io/thread.html | |
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Method_Calls | |
http://ruby-doc.com/docs/ProgrammingRuby/html/tut_methods.html | |
http://rubymonk.com/learning/books/1-ruby-primer/chapters/19-ruby-methods/lessons/69-new-lesson | |
http://rubyfiddle.com/ => run ruby scrips in the browser |
case a | |
when 1 | |
puts "Single value" | |
when 2, 3 | |
puts "One of comma-separated values" | |
when 4..6 | |
puts "One of 4, 5, 6" | |
when 7...9 | |
puts "One of 7, 8, but not 9" | |
when 1..4, 5 |
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html | |
http://ruby-doc.org/downloads/ |
qpdf --linearize input.pdf output.pdf |
require 'nokogiri' | |
Dir.foreach('/Users/geordee/Projects/Data') do |filename| | |
next if filename == '.' or filename == '..' | |
puts "Processing #{filename}" | |
fin = File.open(filename, "r") | |
html = Nokogiri::HTML(fin) | |
textarea = html.search("//textarea") |
require 'fileutils' | |
(0..99).each do |p| | |
p_name = 'klhcc' + (p * 1000).to_s.rjust(5, '00000') | |
FileUtils.mkdir_p (0..99).map{ |c| "#{p_name}/klhcc" + (p * 1000 + c * 100).to_s.rjust(5, '00000') } | |
end | |
Dir.glob("*.md") do |file| | |
filename = File.basename(file, '.md') | |
pf = 'klhcc' + "#{filename.chop.chop.chop}000".rjust(5, '00000') |