Xu Xiaodong avatar Xu Xiaodong committed 3680c2c

add epub2mobi and getrepo

Comments (0)

Files changed (3)

+#!/usr/bin/env ruby
+#
+# name:      epub2mobi, convert epub to mobi
+# author:    Xu Xiaodong <xxdlhy@gmail.com>
+# license:   GPL
+# created:   2011 May 03
+# modified:  2011 May 04
+#
+
+if ARGV.empty?
+  puts 'Usage: epub2mobi <file1.epub> [file2.epub] ... [filen.epub]'
+else
+  ARGV.each do |f|
+    system('kindlegen', f)
+  end
+end
+
+# vim: ai:et:ts=2:sw=2:tw=78:ft=ruby
+#!/usr/bin/env perl
+#
+# name:      getrepo, get vim bundle repository
+# author:    Xu Xiaodong <xxdlhy@gmail.com>
+# license:   GPL
+# created:   2011 May 02
+# modified:  2011 May 04
+#
+
+use Modern::Perl;
+use File::Find;
+
+sub get_url {
+    find(
+        sub {
+            my @urls;
+
+            if ( $_ =~ /(config|hgrc)\z/ ) {
+                open my ($in_fh), '<', $1
+                    or die "Can't open $1: $!\n";
+                while (<$in_fh>) {
+                    push @urls, $1 if /(?:url|default)\s+=\s+(.*)\Z/;
+                }
+                close $in_fh;
+            }
+
+            say for @urls;
+        },
+        "$ENV{HOME}/.vim/bundle"
+    );
+}
+
+get_url() unless caller;
+
+# vim: ai:et:ts=4:sw=4:tw=78:ft=perl
 #!/bin/sh
+#
 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # modified:  2011 Apr 28
 #
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.