Mastering Xcode 3
Thanks everyone whom has attended my workshop session at IP3 Forum. Here’s my slides for you:
IP3 Forum
Interactive Ontario, in partnership with Bell, is pleased to present the Toronto iP3 Forum — a one-day event that will explore the changing mobile landscape and the business opportunities associated with Apple’s Touch Platform (iPhone, iPad and iPod touch), as business models adapt to a market where people are always connected.
iP3 Forum will be hosted on June 21, 2010 at Hilton Toronto, 145 Richmond Street West, Toronto, Ontario (map)
There will be two spread threads running at the same time, business and technology. I will present a tech session in the morning, the topic is “Mastering Xcode”, in which I’ll talk about the tips and tricks which I’ve discovered in the past years.
Actually, I would change the title to “Mastering Xcode 3″ as Xcode 4 is just around the corner. After play with Xcode 4 for couple of hours, I found that a lot of things have been changed. Luckily most of the tips and tricks I will present will still apply to Xcode 4.
The speakers list for iP3 Forum is pretty impressive, look forward to the event on the next Monday. Hope can see you there too!
Xcode 4 Quick Notes
Installation
By default it will install into /Xcode4, so you are safe to just click though almost blindly. This could change after the final release.
After install size is 5GB.
Launch
Very unstable, crashed on the first launch, the reason was because of all my existing Xcode 3 plugins.
Crashed again after removing all the plugins. Then succeed on relaunch.
Look and feel
As you’ve already see from the internet, the first reaction is this thing looks more like iTunes than Xcode 3.
Organizer
Organizer has been redesigned from ground up, it’s much easy to find the information you want.
Another very interesting thing for Organizer is Document has been merged into Organizer now, which will help me to have one less window open.
Preferences
Preferences window has been redesigned and simplified, there are only 7 icons you can click on:
Alerts, which is new. Documents, Fonts & Colors, Text Editing, Key Binding, Building and Source Trees.
Workspace
Favorites Bar is gone, replaced with much more useful Tab bar!
“Get Info” has been converted into “Utility” and put into the workspace as right sidebar.
Original “Project” Tree has been converted into tab based navigator as left sidebar.
Alerts
If you’ve already tried “GrowlCode“, this is not new for you. If not, you’ll love this feature.
iPhone Simulator
There’s one new default app in iPhone Simulator: Game Center, can’t get it working though.
All-in-all
Very well redesigned! Very buggy!
HackerNews OnePage for Safari
“Hacker News” from YCombinator is the major source where I get all the technology and startup news. I love reading it a lot, I’ve even created an iPad app “HackerNews for iPad” so I can enjoy it more.
Couple of days ago, the best update ever happened on Safari, so we can create Safari Extension now!
Here’s my 10 minutes work: “HackerNews OnePage” for Safari: HackerNews.safariextz
The extension only does one thing for now: provides users with the ability to browse Hacker News articles and comments without leaving the page.
How to use it after installation? Just refresh your hackernews page.
This is a port from the great work what Tim Dupree have done on his Chrome extension “Hacker News OnePage“. Thank you Tim Dupree!
Hope you enjoy it!
Best iPad Review – from PCMag
Short and sweet!
PCMag: Apple iPad video review from PCMag.com Reviews on Vimeo.
Top Ten One-Liners from CommandLineFu
Peteris Krumins has done a great job on “Top Ten One-Liners from CommandLineFu Explained”. Here’s my short summary for quick reference:
#1. Run the last command as root
$ sudo !!
#2. Serve the current directory at http://localhost:8000/
$ python -m SimpleHTTPServer
#3. Save a file you edited in vim without the needed permissions
:w !sudo tee %
#4. Change to the previous working directory
$ cd -
#5. Run the previous shell command but replace string “foo” with “bar”
$ ^foo^bar^
#6. Quickly backup or copy a file
$ cp filename{,.bak}
#7. mtr – traceroute and ping combined
$ mtr google.com
#8. Find the last command that begins with “whatever,” but avoid running it
$ !whatever:p
#9. Copy your public-key to remote-machine for public-key authentication
$ ssh-copy-id remote-machine
#10. Capture video of a linux desktop
$ ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg
That’s it.
“Don’t you dare waste your fucking time”
The lovely and amazing performance poet Gabrielle Bouliane performs for the audience at the Austin Poetry Slam.
This would be her last public performance.
Gabrielle was diagnosed with Stage Four Cancer shortly before this video was filmed. Our dear sister fought hard, but she ended her fight January 29, 2010. She was surrounded by family and friends, and her passing was in a very quiet, peaceful room full of love and affection. She was so brave.
Please share this video with everyone you know. I am sure it would tickle her to no end to have this video get as viral as a video can be. Tell the world.
Bunny up!
TextMate Sql Formatter Command
Recently, I am doing some heavy database migrations, so I spend a lot of time on playing with SQL again. It’s fun as always. But there are some SQL files are quite long and messy. There is no problem on running, but it’s really painful to look at and do any changes.
So I went out and tried to find any SQL Formatters. There are quite a few and I’ve tasted them as many as I can.
At the end, I found myself really enjoy using Instant SQL Formatter from Gudu Software. It has a free online sql tidy tool and it’s very powerful:
Instant SQL Formatter is a free online sql tidy tool, actually, it not only can beautify your sql but also can turn your formatted sql into html code, so you can post coloured sql code in your blog, forum,wiki and any website easily. In addition to beautifying SQL code, this sql tool can translate SQL code into C#, Java, PHP, DELPHI and other program languages. Another useful feature is find out all database objects such as table, column, function in sql by selecting output format to list database object.
Here is the Free online Tool and here are some examples you can see. Quite impressive! To format your SQL, you just need paste the sql in the textarea, choose the database and output format then press “Format SQL”, you’ll get the result right away.
Every SQL file looks great now. But after tens of copy & paste and copy & paste between TextMate and browser, it feels not as smooth as I want. I think I should find a better way.
Gudu software does provide some desktop version even add-ins, sadly there are all Windows based. It’s not a option for me.
After reading the page source of their free online tool, here is the result:
#!/usr/bin/env ruby require 'net/http' url = 'http://www.dpriver.com/cgi-bin/ppserver' url = URI.parse(url) http = Net::HTTP.new(url.host, url.port) query = "<sqlpp_request><dbvendor>mysql</dbvendor><outputfmt>SQL</outputfmt><inputsql>#{ENV['TM_SELECTED_TEXT']}</inputsql><formatoptions><keywordcs>Uppercase</keywordcs><identifiercs>Lowercase</identifiercs><functioncs>InitCap</functioncs><lnbrwithcomma>after</lnbrwithcomma><liststyle>stack</liststyle><salign>sleft</salign><quotechar>\"</quotechar></formatoptions></sqlpp_request>" header = { 'Referer' => 'http://www.dpriver.com/pp/sqlformat.htm', 'User-Agent' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.1) Firefox/3.0.1' } resp, data = http.post(url.path, query, header) puts resp.error! unless data formatted_sql = data[/<formattedsql>.*<\/formattedsql>/m].gsub(/<\/?.*>/, '') puts formatted_sql
Download TextMate SqlFormatter Command
How to install?
After save to your own disk, unzip it, just open those tmCommand files and add them into your TextMate. The shortcut key has been set to Command+Shift+F for now.
As you can see there are two tmCommand files. The “SQL Formatter – Stack” will format you sql with every fields has its own line, the “No Stack” one will put all the fields into one line. Try them and you’ll see the difference.
How to use it?
Open TextMate, select the SQL query you want to format and press Command+Shift+F. The beautiful formatted SQL will replace the selected SQL “instantly”!
Requirement?
The command is using free online Instant SQL Formatter, so the internet is required.
What’s next?
As I said before, SQL Pretty Printer is really powerful. I really should create a complete TextMate Bundle instead of just one command. But before doing this, I should get the permission from them now.
Any update will be posted here, hopefully soon.
Enjoy the SQL Formatter Command and stay tuned for more.