This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| # input may be given as "2:00 PM" or "14:00" | |
| # timeconverter.rb "2:00 PM" "5:00 PM" | |
| # timeconverter.rb --from="America/Denver" "2:00 PM" | |
| # http://tzinfo.rubyforge.org/doc/files/README.html | |
| require 'rubygems' | |
| require 'tzinfo' | |
| require 'time' | |
| require 'choice' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| =begin | |
| * Name: pl.rb | |
| * Description parses xml iTunes Music Library and extracts playlists | |
| * Author: | |
| Original - Aaron Patterson (xml parsing) | |
| http://groups.google.com/group/nokogiri-talk/browse_thread/thread/97973521c6f5f0dc | |
| * Additions by rkumar | |
| * Date: 2010-08-02 22:02 | |
| * License: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| =begin | |
| * Name: xml.rb | |
| * Description parses xml iTunes Music Library and inserts into database | |
| so other apps can use, rather than each time parsing xml file | |
| * Author: Original - Aaron Patterson (xml parsing portion) | |
| http://groups.google.com/group/nokogiri-talk/browse_thread/thread/97973521c6f5f0dc | |
| * Additions by rkumar | |
| * Date: 2010-08-04 | |
| * License: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* create tables to store itunes music library data for quick access | |
| - rkumar 2010 July | |
| */ | |
| drop table tracks; | |
| create table tracks ( | |
| album_artist VARCHAR(50), | |
| album_rating_computed INTEGER, | |
| album_rating VARCHAR(50), | |
| album VARCHAR(50), | |
| all_items VARCHAR(50), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| #################################### | |
| # iTunes Command Line Control v1.0 | |
| # written by David Schlosnagle | |
| # created 2001.11.08 | |
| # edit 2010.06.01 rahul kumar | |
| #################################### | |
| showHelp () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'highline/import' | |
| require 'readline' | |
| # Sunmary of the program | |
| # shows me all modifed files and gets commit message | |
| # THIs is a copy of gdc.sh, but i was unable to get readline to work in that. | |
| # Also notice how much cleaner this is. | |
| # uses readline to show me some common ones, and allows me to reuse any new ones | |
| # TODO: We need to add die and a few more and make it standard quick script | |
| # or put those in a separate small ruby file (cmdapp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| # R Kumar | |
| # 2010-06-29 10:24 | |
| require 'fileutils' | |
| require 'tempfile' | |
| # edits given text using EDITOR | |
| # @param [String] text to edit | |
| # @return [String, nil] edited string, or nil if no change | |
| def edit_text text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| ###################################### | |
| # A tiny wrapper over optparse that gives easy subcommand facility. | |
| # It also neatly prints help for global and subcommands | |
| # as well as summarizes subcommands in global help. | |
| # | |
| # @author Rahul Kumar, Jun 2010 | |
| # @date 2010-06-20 22:33 | |
| # | |
| # @examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| ###################################### | |
| # A tiny wrapper over optparse that gives easy subcommand facility. | |
| # It also neatly prints help for global and subcommands | |
| # as well as summarizes subcommands in global help. | |
| # | |
| # For updated version, goto : http://github.com/rkumar/subcommand | |
| # | |
| # @author Rahul Kumar, Jun 2010 | |
| # @date 2010-06-20 22:33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| ## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
| ## Note you cannot do: opt.rb help command | |
| ## other options are commander, main, GLI, trollop... | |
| # run it as | |
| # ruby opt.rb --help | |
| # ruby opt.rb foo --help | |
| # ruby opt.rb foo -q | |
| # etc |