Top 5 iPhone Apps

1. NewsStand

This is probably the app I use the most. It's an RSS reader with some of the best features out of all RSS readers on the app store. (And hell, I've tried dozens of RSS readers, with most of them crashing or not syncing correctly.) Coming from the Netnewswire iPhone app, this one demolishes it. It syncs nicely with your Google Reader account, and you can do lots with entries (twitter, email, etc.).

newsstand3 newsstand2newsstand1


2. GoodReader

This is the second most-used app on my iPhone. I always feel like I have to be reading something, and this is the best tool out there to read ebooks. Unlike many PDF readers on the app store, this one works flawlessly with big PDFs. I can open a 60 MB PDF without a problem. It renders nicely, I can do a search, select text, add a bookmark, open PDFs chapters (if there are any), zoom in/out, and other great stuff. Aside from PDFs, it can open HTML documents and images (PNG, JPG, GIF). It also has some great file management features, like rename files, move, and delete all within the app. It saves all files on the iPhone, so you don't need an Internet connection.

How do you get your PDFs on the iPhone, you ask? There's three ways and you don't need additional software for it. The first is the slowest: you can enter a URL to a document on the web (PDF, JPG, GIF, etc.) and it will download it and save it on the iPhone. Second, and the fastest way to transfer: within the app, it can turn the iPhone into a file server via wifi, and you can connect to it from your OS, where you can drag and drop files easily. The last way is by connecting to a web gui, which appears when you have the app running as a server - there's easy-to-understand instructions on how to do this within the app.

GoodReader1 GoodReader2 GoodReader3 GoodReader4


3. Yelp

Pretty popular app. Find restaurants, and other places of interest around your area. The best thing about this app is the reviews you find for locations.

4. CityTransit

Subway map of Manhattan. The best thing about this app is it will tell you what subway lines are near you and point it out on Google Maps. Nuff said.

5. FTPonTheGo

FTP client for the iPhone. You can edit files live on your server. Awesome.

Best Practices for Speeding Up Your Web Site

Yahoo has this awesome article on speeding up your web pages. Granted, most of this could be plucked out directly from your site using the Yahoo! YSlow Firefox add-on, but I highly recommend you checking it out. Here’s a summary of what they have to offer:

  1. Minimize HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires or a Cache-Control Header
  4. Gzip Components
  5. Put Stylesheets at the Top
  6. Put Scripts at the Bottom
  7. Avoid CSS Expressions
  8. Make JavaScript and CSS External
  9. Reduce DNS Lookups
  10. Minify JavaScript and CSS
  11. Avoid Redirects
  12. Remove Duplicate Scripts
  13. Configure ETags
  14. Make Ajax Cacheable
  15. Flush the Buffer Early
  16. Use GET for AJAX Requests
  17. Post-load Components
  18. Preload Components
  19. Reduce the Number of DOM Elements
  20. Split Components Across Domains
  21. Minimize the Number of iframes
  22. No 404s
  23. Reduce Cookie Size
  24. Use Cookie-free Domains for Components
  25. Minimize DOM Access
  26. Develop Smart Event Handlers
  27. Choose over @import
  28. Avoid Filters
  29. Optimize Images
  30. Optimize CSS Sprites
  31. Don’t Scale Images in HTML
  32. Make favicon.ico Small and Cacheable
  33. Keep Components under 25K
  34. Pack Components into a Multipart Document

Another great article to check out is this one.

ANT Script to Deploy

A friend of mine asked me to post a simple script to show the power of ANT. Here it is with comments that show some of the things you can do with it. To read how to set up ANT and run scripts, please read my earlier post on doing so.

This script gets the latest from an SVN repo, deploys using FTP, then sends an email using a Gmail account. Here’s the ant script (deploy.ant), followed by a properties file (i.e. the config file, deploy.properties), which the ANT script pulls from:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0"?>
<!-- ======================================================== -->
<!-- Sample build file used to retrieve svnant's sources -->
<!-- ======================================================== -->
 
<!-- TODO: Mail if the script failed --> 
 
<project name="STAGING-Deploy" basedir="." default="empty">
 
  <property file="STAGING-Deploy.properties" />            
  <!-- Import SVNAnt tasks from jar files.  -->
  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" />
 
  <target name="Deploy"> 
    <!-- Step 1: Export the latest files from the repo to local machine. -->
    <antcall target="export" />
 
    <!-- Step 2: FTP the files from the local machine to STAGING. -->
    <antcall target="ftp_files" />
 
    <!-- Step 3: Cleanup. -->
    <antcall target="cleanup" />  
  </target>  
 
 
  <!-- SVN Checkout (Latest) -->
  <target name="checkout_latest">
    <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
      <checkout url="${svnant.projectrunk.url}" revision="${svnant.checkout.revision}" destPath="${svnant.checkout.destpath}" />
    </svn>    
  </target>   
 
  <!-- SVN Update -->
  <target name="update_latest">
    <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
      <update dir="${svnant.update.directory}" recurse="${svnant.update.recurse}" revision="${svnant.update.revision}" />
    </svn>    
  </target>  
 
  <!-- SVN Export  -->
  <target name="export">
    <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
      <export srcUrl="${svnant.export.srcurl}" destPath="${svnant.export.destpath}" force="${svnant.export.force}" />
    </svn>    
  </target>
 
  <!-- FTP the export of the latest revision to STAGING. -->  
  <target name="ftp_files">    
    <!-- Import FTP tasks from jar files.  -->
    <taskdef classname="org.apache.tools.ant.taskdefs.optional.net.FTP" name="ftp" />
 
    <ftp server="${ftp.server}" port="${ftp.port}" remotedir="${ftp.destination}" userid="${ftp.userid}" password="${ftp.password}" 
         passive="${ftp.passive}" depends="${ftp.depends}" binary="${ftp.binary}" retriesAllowed="${ftp.retriesallowed}" verbose="${ftp.verbose}">
 
      <fileset dir="${svnant.export.destpath}" />
 
    </ftp>    
  </target>  
 
  <!-- Cleans Up: Remove temp info, etc. -->
  <target name="cleanup">  
    <delete includeEmptyDirs="true">
      <fileset dir="${svnant.export.destpath}"/>      
    </delete>
 
    <!-- Email Notification -->
    <mail mailhost="${mail.host}" mailport="${mail.port}" subject="${mail.subjectalert}" ssl="${mail.ssl}" user="${mail.username}" password="${mail.password}">
      <from address="${mail.from}"/>      
      <to address="${mail.to}"/>
      <message>The nightly build has completed.</message>
    </mail>
 
    <echo>Cleanup complete. </echo>
  </target>
 
  <target name="empty">    
    <echo>Pass in a default target to call </echo>    
  </target>
 
</project>

Now let’s check out the properties file (deploy.properties):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -----------------------------------------------------------------------------
# STAGING-DEPLOY
# Variables are initialized here.
# -----------------------------------------------------------------------------
#
# NOTE: Backslashes have to be escaped with another backslash (on Windows)
#
 
# === INIT =====================================================================
svnant.projectrunk.url=svn://192.168.3.142/TESTING/trunk
svnant.repository.user=YOURUSERNAME
svnant.repository.passwd=YOURPASSWORD
 
# === CHECKOUT (INITIAL) =======================================================
# Check out a working copy of the latest to a local directory.
svnant.checkout.destpath=C:\\testing123
svnant.checkout.revision=HEAD
 
# === UPDATE TO LATEST =========================================================
# Update the working copy of your local directory to latest revision
svnant.update.directory=C:\\Experiments\\Firehawk\\src_latest
svnant.update.revision=HEAD
svnant.update.recurse=true
 
 
# === EXPORT ===================================================================
# Copies From Source Repo:
svnant.export.srcurl=${svnant.projectrunk.url}
 
# Into a temporary directory in your ant home (that will be FTP'd):
svnant.export.destpath=${ant.home}\\export-temp
 
# Overwrite (needs to in case the file changed)? 
svnant.export.force=true
 
PBNStagingFTP
# == FTP INFO ==================================================================
# FTP what was exported (latest version) to this location on staging:
ftp.destination=/testing/
ftp.server=TESTING
ftp.port=21
ftp.userid=USERNAME
ftp.password=PASSWORD
ftp.passive=yes
ftp.depends=yes
ftp.binary=yes
ftp.retriesallowed=5
ftp.verbose=yes
 
# == MAIL INFO ==================================================================
# Currently using GMAIL for now.
mail.host=smtp.gmail.com
mail.port=465
mail.subjectalert=[STAGING ANT Build] Test build
mail.ssl=yes
mail.username=USERNAME
mail.password=PASSWORD
mail.from=someone@somewhere.com
mail.to=someone@somewhere.com

Executable Extension

Want to run a script in the command console that is not of type EXE, COM, BAT by just typing in the name of the script? Have a script in Perl or Python that you have that you want to run without typing the name of the interpreter with switches? It's pretty easy to do in Windows.

  1. Open up System Properties and click on Environment Variables:



  2. Select the PATHEXT System variable and click on the Edit button.



  3. Add the extension you want. In this case, let's add the extension for .PL so we can run Perl scripts without typing in the name of the Perl interpreter:



  4. Hit OK on the Windows.

  5. In an Explorer Window, Go to Tools -> Folders



  6. In the Folder Options Window, click on the File Types tab, and then click New:



  7. Type .PL for the File Extension



  8. Click OK then Click on the Advanced button to open up the Edit File Type and click on New...



  9. Enter the name of the interpreter:



  10. Hit OK for all Windows.

  11. You're set and good to go.

Now let's test it. Make a .pl file under c:\ called "add.pl". Make add.pl be:

1
2
$sum = $ARGV[0] + $ARGV[1];
print "\nSum of the numbers is: $sum\n\n";

 

Now let’s call it via the console by typing:

1
add 5 5

9