Friday, August 27, 2010
Taskpaper vim script to insert @done tags
Saturday, July 24, 2010
Cheap git repositories with Dropbox
But if you want something to back up local development or to collaborate in a small team for free, you might consider Dropbox and git.
Now one (perhaps big) proviso - you may have data sync issues if using this between more than one person so you'd have to coordinate commits.
You can download git for mac, pc or linux. See here:
http://git-scm.com/
http://gitbox.pierlis.com
http://code.google.com/p/msysgit/
So you'll want to put your project under git source control first. There are plenty of tutorials to tell you how to do that.
Let's call the project mygitproject. Let's assume we're using a Mac to do this. Back up your source before trying this in case of errors.
Now, create a cloned git repository in our Dropbox account. The repository doesn't use a working folder as well, it just has the git system files. We will use this cloned repository to push changes to from our local project folder and it'll eventually sync to the Dropbox servers.
Change directory to your Dropbox folder:
$ cd ~/Dropbox
create a folder to hold the git repositories
$ mkdir git
$ cd git
create a folder for mygitproject
$ mkdir mygitproject
Now clone the mygitproject (assume it's in ~/projects folder). The mygitproject has to already be under git source control. Use the --bare switch so the working folder isn't used (just the git system files).
$ git clone --bare ~/projects/mygitproject
This will clone the repository to the ~/Dropbox/git/mygitproject/mygitproject.git folder.
Change to your project folder and to make it easy, create a remote link to your Dropbox repository called dbgp:
$ cd /projects/mygitproject
$ git remote add dbgp ~/Dropbox/git/mygitproject/mygitproject.git
If you want to push changes to the repository, perform your commits to your mygitproject then push them:
$ git push dbgp
You can do any change you like to your local repository and push the changes to your Dropbox account, including branches and tags and all the git magic. It's also pretty fast.
Only one warning - make sure Dropbox has finished caching the changes to its server before trying to refer to the repository from elsewhere.
You could go to another computer that had the same Dropbox account and do a:
$ cd ~/projects
$ git clone ~/Dropbox/git/mygitproject/mygitproject.git
This would check out the mygitproject to the ~/projects/mygitproject folder. You could then push or pull from it to collaborate. Again, beware the sync issues! I know this approach works but I waited for the dropbox syncing to stop first. Another user may not.
You can also share a Dropbox folder out to another Dropbox user and they see it in their ~/Dropbox folder, so this sharing approach might work too (though I haven't tested it).
But anyway, it's useful for making an offsite backup of your git repository.
If you need something more, try github, it's excellent. Dropbox is great software too.
Monday, July 19, 2010
Command-line calendar info goodliness with iCalBuddy
Another great tip I got from onethingwell - excellent blog: http://onethingwell.org/
Tuesday, July 13, 2010
Open a terminal window from Finder
Tiny, but handy if you drop to Terminal often.
via @onethingwell
Friday, May 07, 2010
IPad Review 2
So I've had the iPad for a week today. I'm writing this review with the wireless bluetooth keyboard and Pages sitting in a comfortable chair with the device just resting on the arm of the chair and the keyboard on my lap. It's actually pretty comfortable. [And now I'm continuing to write this while sitting on a chair at the airport with the iPad propped up in a baggage trolley and typing on the bluetooth keyboard. Geek points ++]
So what do I think after a week of using the device? I wouldn't be without it now. It definitely is not the best for some tasks, but it's perfect for others. And the flexibility is it's real selling point. There's just so much you can do with this device and it's only been available for a month. To really understand what this means, wait for 2 years and when the weight and price drops to $200. Wait until children are glued to these devices for playing games and learning. And wait until there are apps that make 50 types 30 second tasks almost instant and this device (and the inevitable copies in the market) is here to stay.
First the stuff I don't like. It desperately needs to solve the file system problem. The market is bifurcating around online solutions like Dropbox and that's fine but the connecting interfaces between applications has been purposefully stymied and it shows. Not having a unified approach to filing actually cripples this functionality. I know it'll change, but it's half-baked right now and it's annoying in practice. The iWork apps are great but don't import/export very well and always drop formatting detail or just plain detail. Advanced Excel formulas like sumproduct() just get stripped when converting and most Word styles get stripped too.
Can't wait for the iPhone 4.0 changes, but fall is a long way away. Multitasking and apps that take advantage of the multitasking interfaces will be very welcome as that's one of the constraining characteristics of this device. The other missing piece is having to reach and touch the screen when you've got the bluetooth keyboard activated. Right now you have to do the same with a computer but you have a mouse. While it's totally possible to implement a bluetooth mouse driver and render a mouse cursor on the screen, I really doubt Apple would do that too, even though it would go a long way to not making the user reach up and touch the screen. It would make a lot of sense though as the bluetooth keyboard and stand make this quite a dockable computer. Being able to command-tab would be HUGE although I doubt Apple will implement the support when using a bluetooth keyboard (but how many hundreds of times a day do I use that keyboard combination).
Apps need to catch up, though I'm not complaining much. Wait another 1-3 months and we'll see a landslide of incredible functionality. A big thanks to those people that have made awesome iPad apps already. Here's a list of the apps I use and love:
Kindle, IMDB, At Bat 2010, Now Playing, Amazon.com, Marvel and Comics, Plants vs Zombies HD, GoodReader, Instapaper, Labyrinth 2 HD, ABC Player, Brushes, Pinball HD, Pandora, Bubbles, Time Editor's Choice, Guardian Eyewitness, GoToMeeting and of course my app, Reef Fish Book HD :).
iPhone apps I'd love to see for iPad are:
Skype, Taskpaper, Files, Tweetie, digg, Wired
I was listening to a talk on a gdgt round table podcast and people that had tried to make the iPad a laptop replacement have felt constrained but this device is about context and specific use-cases right now. For example, watching streaming video by just standing the device up against the wall while cleaning the kitchen is totally possible. The speakers are so clear and so good you can hear the video over the sound of running water. The screen is so bright and clear you can see it easily from across the room. It's great for quick google searches for recipes.
I love reading on this device - the huge screen and brightness control means I'm consuming a bunch of material via kindle, safari, instapaper and via twitter. Comics are great to read and there's a few free ones (I'm yet to buy one). It's a far more pleasurable device to read this material on than a laptop screen. You can hold it closer to your face than you would a laptop. The device does get a bit heavy but it's not so bad. You just lean it on things or prop it up.
My wife loves the brushes application. She's artistically inclined and was drawn to this app immediately. Watch out - if you think you won't have to share the iPad with your the family members, think again. This thing is seriously fun.
The pinball HD app with it's speedy graphics and pinball sounds is so great on the iPad. The Labyrinth app is wonderful for kids. And don't get me started on Plants vs Zombies. I have to ration myself on that app because it's so much fun. Your hands blur over the screen in this gameplay - if you think it's the same as a regular computer then imagine using both hands and multiple fingers to capture falling sunlight and using another hand to drag new plants down to the field. It's so much fun and so much more tactile than the ordinary computer experience.
People have complained about needing to touch the screen to do certain things - you can't use the keyboard for everything. But it's not bad - the cursor keys work, as do option-arrow to jump word by word and even option-shift-arrow to highlight by word. So I think keyboard support will get even better over time.
Something else that's really significant is that this is a device that is to be shared with others. I actually prefer to download pictures from my camera to the iPad to view them - it's so much better than on a laptop screen. I guess on a 27" iMac you might find a better experience for viewing but this one is very good. The iPad photo app desperately needs editing and favourites though because it's such a good way to vet photos. If you could mark photos and then upload them to Google/Picasa I'd be in heaven but I may need to wait awhile for that to be a reality.
Okay well we're now at the boarding gate about to head to Australia. While the honeymoon is definitely over, this device is fitting into my life in all sorts of great ways. I'll upload this to the blog over my 3G connection. The tweet about it. Maybe I'll write more later - there's more to say.
Saturday, May 01, 2010
Copying movie files to the iPad from an external hard drive
I use a laptop as my primary iTunes syncing device and even though it has a 300 gig drive, movie files eat that up fast so I use an external Drobo with 6TB of space to hold large media.
If you want to copy your videos to iTunes but don't want to copy the movie file to the local iTunes collection, go into iTunes, Preferences and under the Library tab *uncheck* "Copy media when adding to iTunes library". Then drag your movies directly from the external drive to your iTunes library.
Click on the iPad when connected in iTunes and choose the Movies tab. Check the movies you want on the iPad and click apply. This will copy the movies to the iPad.
Remember to re-check "Copy media" option above if you want this to be the default when adding music (I do this because it's convenient).
If you disconnect the drive and re-sync it throws an error but the movies stay on the iPad and you don't lose all your laptop hard-drive space.
Sunday, April 04, 2010
iPad review
Sunday, March 28, 2010
Convert your mail.app notes to text files for use with Notational Velocity and sync
Recently I wanted to move my notes from mail.app and the notes app on the iPhone to text files. This would then allow me to use Notational Velocity with markdown hack and simpletext.ws that I use with the excellent Taskpaper iphone app by Hogg Bay Software.
You can download the script files here or copy and paste from the article.
Here’s how I got it to work. I really hope I’m not missing a trivially easy way to do this but this way did work for me!
- Export from Mail to an archive. This is a plain text file.
- Download MacVim
- Run a script over archive file to reduce it to text
- Run ruby script in new folder to convert notes to text files
Export from Mail.app to an archive
- Click on notes
- Mailbox | Archive Mailbox
- Choose a new empty folder like ~/Downloads/Notes
- Copy the Notes.mbox/mbox file to ~/Downloads/Notes. You won’t need the table
_of
_contents file.
The ~/Downloads/Notes/mbox file contains all the notes in a single text file with a bunch of markup.
Download MacVim
- Download MacVim
- Drag to applications folder and open
Run vim script to convert mbox text file
The script:
:%s/ / /g
:%s/<br class="[^"]*">//g
:%s/<br>//g
:%s/=\n/ /g
:%s/<div>\([^<]*\)<\/div>/\r\1/g
:%s/^X-Universally.*\n//g
:%s/^Content-Type: text\/html;\n//g
:%s/^\tcharset=us-ascii\n//g
:%s/^X-Uniform-Type.*\n//g
:%s/^Message-Id: .*\n//g
:%s/^X-Mail-Created-Date.*\n//g
:%s/^X-Mail-Generated.*\n//g
:%s/^Content-Transfer-Encoding.*\n//g
:%s/^Mime-Version:.*\n//g
:%s/^X-Apple-Base-Url:.*//g
:%s/^X-Apple-Mail-Remote-Attachments:.*//g
:%s/^From: .*\n//g
:%s/ -0400$//g
:%s/<span [^>]*>//g
:%s/<\/span>//g
:%s/=?MACINTOSH?Q?//g
:%s/=CA? Date: .*//g
:%s/^\tcharset=.*\n//g
:%s/<div>\([^<]*\)<\/div>/\r\1/g
:%s/<div>//g
:%s/<\/div>//g
:%s/<[^>]*>//g
:%s/=CA//g
:%s/? //g
:%s/_//g
:%s/=92/'/g
:%s/\s\+$//g
:%s/#\(\a\+\)/@\1/g
:%s/^Subject: /!!!\rSubject: /g
- Save the above vim script to a file, like ~/notes.vim using a text editor.
- Right-click on the plain text mail archive file you created above (~/Downloads/Notes/mbox) and choose: Open With | MacVim. You can also launch MacVim and open the mbox file with File | Open.
Type:
:so ~/notes.vim
Or whatever you named the vim script.
- This will convert the file to text. You may need to do some small other adjustments - this script worked well on my file.
What is remaining is a list of Subject: *, Date: * and message body blocks with the !!! separating the entries. We’ll use this in the ruby script to convert them to text files. - Choose File | SaveAs to save the modified file to the filename “notes.text”, let’s say ~/Downloads/Notes/notes.text
Run ruby script to convert to text file
Most mac systems these days have ruby. To test, open the Terminal and type:
ruby --version
It should return something like:
$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Save the script below to ~/Downloads/Notes/n.rb
class WriteNotes
@counter = 0
def WriteNotes.writeout(subject, note, date)
# write out new file
if subject != ""
# make subject the filename
filename = subject
# limit file names to 50 chars - make longer if required
if filename.length > 50
filename = filename[0..50]
end
# strip out filename-unfriendly characters
filename = filename.strip.gsub(/ /,"_")
filename = filename.gsub(/[?:,@="'.\\\/]/,"")
# check if we have a date in the date field (basic check)
d = date[0..1].match(/[0-9]/)
# default a current date if date not found
if !d
date = Time.now.localtime.strftime("%Y-%m-%d")
end
if date.strip.length == 0
date = Time.now.localtime.strftime("%Y-%m-%d")
end
# remove comma from date if it's non-standard, like "Aug, 2"
date = date.gsub(/,/,"")
# filename template - change to taste
filename = "zan-" + date + "-" + filename + ".txt"
# write out file
notefile = File.open(filename, "w")
notefile.puts note
notefile.close
@counter = @counter + 1
# puts "__filename[#{@counter}]: " + filename
puts "Subject: [#{@counter}]" + subject
# puts "__note: " + note
end
end # writeout
subject = ""
note = ""
date = ""
file = File.open("notes.text", "r")
while (line = file.gets)
if line[0..2] == "!!!" # at a new note
# write out new text file
writeout(subject, note, date)
# init vars
subject = ""
note = ""
date = ""
else
# collect data into subject, note, date fields
m = line[0..7]
# puts m
if m == "Subject:"
subject = line[8..line.length].strip
note = ""
else
if line.strip[0..3] == "Date"
date = line.strip[6..15]
date = date.gsub(/:/,"")
date = date.gsub(/ /,"_")
else
note = note + line
end
end
end
end # while
writeout(subject, note, date)
puts "total files: #{@counter}"
file.close
rescue => err
puts "Exception: #{err}"
err
end
Open terminal (under Utilities in Applications folder) and type:
cd ~/Downloads/Notes
Now we can run the script, type:
ruby n.rb
If the script runs correctly, the notes.text file will be processed and each file will be written out in the format:
zan-YYYY-MM-DD-.txt
If there is a problem, just remove the text files generated and start again (rm *.txt)
Good luck! The vim script and ruby script may require a little tweaking. Please leave a note if you found this useful.
Friday, March 19, 2010
Get etude and learn the piano
Want to learn the piano and download free sheet music? This great app will help. etude is US$3 (introductory price) and has a selection of music for free in the in-app store. You can download sheet music like Moonlight Sonata and Fur Elise to your bookshelf. The range is limited, but the app only just came out. The same developer (Wonder Warp Software) has released Shovebox Mobile.
Etude really shines when you open the score. It will play at different speeds and shows a keyboard with lit-up keys. You can move the play cursor along at your own pace and work the keys out or have the app play the music for you.
The app needs better music management and a search feature and it should remember your position when you exit the app but for a beginner learning sheet music, it’s still excellent.
Friday, March 05, 2010
MacHeist NanoBundle
MacHeist is running another bundle for only US$20 for the next couple days.
I am a user of RapidWeaver, which was part of a previous bundle, and can highly recommend it for developing pretty web sites fast.
My main reason for purchasing was the inclusion of MacJournal which looks to be a rather neat way to write and maintain a journal and publish the journal online should you wish.
I am very interested in using the file transfer software Flow. The other utility software, like Tracks and RipIt look cool enough to give a try.
There is also Clips and CoverScout which might be useful to someone.
The Tales of Monkey Island are old games, but damn they were entertaining back in the day. AirBurst Extreme is somewhat awkward to control. Burning Monkey Solitaire is a colourful entertaining version of Solitaire with a very wide range of Solitaire rules and random noises and jokes thrown in - surprisingly fun.
Tuesday, January 12, 2010
To:Mail.app From:MacHackShack.com Subject:Advanced keyword searching with Mail.app and spotlight
Try:
to:someone from:someone subject:something