November 26th, 2008 |
Published in
Development | Comment
Here’s a snippet to resize a background image to the dimensions of an element. In this case, #bkgImage.
var resizeBkg = function() {
var h = self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var w = self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var e = document.getElementById('bkgImage');
if (w > h) {
e.width = w;
e.height = w;
} else {
e.height = h;
e.width = h;
}
}
October 2nd, 2008 |
Published in
Technology | Comment
Woah. As if having the creative likes of Obey Giant (Shepard Fairey), ISO50 (Scott Hansen), and Sarah Silverman weren’t enough, a couple of iPhoneDevCamp alumni volunteered to create an iPhone and iPod Touch application for Barack Obama.
You’ll have instant access to Barack’s positions on important issues, as well as local and national campaign news as it happens. Photos and videos from the campaign trail are all here, too.
- Call Friends: A great volunteering tool that lets you make a difference any time you want by talking to people you already know. Your contacts are prioritized by key battleground states, and you can make calls and organize results all in one place.
- Call Stats: See nationwide Obama ‘08 Call Friends totals and find out how your call totals compare to leading callers.
- Get Involved: Do more. Find and contact your local Obama for America HQ.
- Receive Updates: Receive the latest news and announcements via text messages or email.
- News: Browse complete coverage of national and local campaign news.
- Local Events: Find local events, share by email and get maps and directions.
- Media: Browse videos and photos from the campaign
- Issues: Get clear facts about Barack Obama and Joe Biden’s plan for essential issues facing Americans.
I wonder how the McCain camp will follow up on this. For some reason, every time I associate John McCain and the web, I seem to refer to Mike Davidson punishing McCain’s web team for hot linking images on John McCain’s MySpace page. Classic.
Anyways, enough of the reminiscing. I commend the iPhoneDevCamp alumni amongst the other 4 who volunteered their time to the project. It truly gives some boost and good press to the iPhone development platform and its everyday application; whether it be checking your health, to learning why to vote for a presidential candidate.
The app is available at http://my.barackobama.com/page/content/iphone
September 25th, 2008 |
Published in
Technology | Comment
Since writing about the Adobe CS4 live web broadcast a couple of days ago, I was fortunate enough to finally view it. Enjoy!
You may view the video at a higher resolution via http://tv.adobe.com/#vi+f1556v1715. You may also find other related videos on that page with regards to CS4. The ones I am interested in seeing would probably be the following:
All I can say is that this is going to be one very nice Suite, and should be fun to play/work with.
September 16th, 2008 |
Published in
Development | Comment
Ever accidentally do an svn checkout instead of an export? Here’s a command-line snippet to take care of those hidden .SVN directories:
rm -rf `find . -type d -name .svn`
Warning: Take great care when using “rm -rf” always.
August 15th, 2008 |
Published in
Technology | 2 Comments
Ever had the situation where you have synced your iPhone (to iTunes OS X) and happen to sync both the contacts from your Address Book and Google Contacts? Or, just happen to add someone’s new contact info as another contact-card? Well, here’s how I cleaned and merged duplicate contacts so that my Address Book performs like a champ.
- Launch Script Editor (Applications/AppleScript/Script Editor)
- Paste the following code snippet
tell application "Address Book"
set biglist to {}
set theGroup to count every person
if not (exists (group "Duplicate Entries")) then
make new group with properties {name:"Duplicate Entries"}
end if
set the_names to the name of every person as list
repeat with i from 1 to number of items in the_names
set this_Name to item i of the_names
set theName to name of person this_Name as string
if this_Name is not in biglist then
copy this_Name to end of biglist
else
add (people whose name is theName) to group "Duplicate Entries"
end if
end repeat
save addressbook
end tell
- Save your newly created script (would usually default to ~/Documents/AppleScripts/), and just open/run it
Now, the easiest way to figure out if its running or not (at least for me) was to run the Activity Monitor and sort by CPU. I simply just waited to see if Address Book would climb to the top doing 90+, and back down to nil. When this is done, you should be able to see a group called “Duplicate Entries”. From there, you may now sort through the details and delete the ones that you don’t need.
Note: You can also do a quick merge via Address Book itself from duplicate contacts. However, you won’t be able to see which contacts are being merged as its just a set-it-and-forget kind of deal. If you do not care and simply just want to get rid of those dupes, you can do so by doing the following:
- Launch Address Book
- Select Card from its menu
- Then, select Looking for Duplicates… and just go through the following prompts after search results finishes