Remove Declined Facebook Events from the iOS 6 Calendar

If you’re using a device with iOS 6, and have enabled Facebook Integration, you may have noticed its annoying habit of displaying events you have said you’re not going to. I don’t know about you, but I like to keep my calendar looking as clean and concise as possible. Any invite I decline gets removed immediately to avoid any confusion.

That Facebook Events would still appear even after I had declined was an annoyance – and I hope, a bug. What exacerbates the issue is there is no way to remove the event from the calendar app manually. The straw that broke the camel’s back, however, was one particular event which instead of repeating every Thursday, showed as running every day for the next few years. Every. Damn. Day.

I needed a solution to this. In the end, I hit on two things which must have sorted it… one of them worked, I’m just not sure which. “Huzzah!” for clear documentation!

1. Remove the Event through the Facebook Website.

Hover over the event in your event list. A blue “X” icon appears in the upper-right corner. Click it.

2. Change your Event Settings to Hide Declined Events.

In the upper-right of the Events page is a small cog icon.

Click it, then click “Settings” in the drop-down menu.

In the dialog box which appears, untick the box to “show declined events”.

An alternate universe – Marco.org

An alternate universe – Marco.org

Sounds quite a lot like the experience in just about any high-street Electronics store in the UK, but with better décor. Although I rarely buy in an Apple store (shocking, I know!), I prefer their hands-off approach – let the customer explore the product on their own, and be on hand if they have any questions. “Hard sells” are really off-putting. If it’s good enough, your product will sell itself.

Apple complies with UK judgment, acknowledges that Samsung didn’t copy iPad design, injects a bit of snark

Apple complies with UK judgment, acknowledges that Samsung didn’t copy iPad design | The Verge

Did anyone expect Apple to do anything but highlight the statement from the judge on how much “cooler” the iPad was compared to the Galaxy Tab?

Worth noting: despite what was widely (and incorrectly) reported, Apple never had to issue an apology to Samsung Only an acknowledgment of the ruling.

The iPad Mini is The iPod Mini All Over Again

Things said about the iPod Mini:

  • Competitors are cheaper
  • Competitors have more features
  • Competitors are smaller
  • It’s not “open”
  • It’ll never sell (or, my favourite: “the only people who’ll buy it are Apple ‘Sheeple/fanboi’s/posers’ with too much money”)
  • You’re paying an “Apple Tax” just because it looks pretty/has an Apple logo

Things said about the iPad Mini in the 24 hours since it was announced:

  • Competitors are cheaper
  • Competitors have more features
  • Competitors are smaller
  • It’s not “open”
  • It’ll never sell (or, my favourite: “the only people who’ll buy it are Apple ‘Sheeple/fanboi’s/posers’ with too much money”)
  • You’re paying an “Apple Tax” just because it looks pretty/has an Apple logo

Even though I doubt I’ll be buying one in the short-term, make no mistake – I think the iPad Mini will sell in droves, just like the iPod Mini went on to.

I confidently believe it will outsell the Google Nexus 7, and probably also the Kindle Fire (the biggest competition in my mind) this Christmas, despite the much higher price. Apple has shown consumers will pay that extra “tax” for the overall experience. Not only that, Joe/Jane Consumer can now see the name brand iPad on sale below £300 for the first time. That’s a really big deal for anyone not trapped in the Tech Bubble.

On The Kindle Fire HD

Last night Amazon announced the Kindle Fire HD, its updated foray in the tablet market. I jumped the gun a bit on Twitter, when – while Jeff Bezo’s was hammering on about how it was the “best tablet at any price” – I bemoaned

Like I said, I jumped the gun; later that night, Amazon put up pre-orders for the Kindle Fire + Kindle Fire HD on Amazon UK. However…

  • We’re only getting the 7-inch models. No 8.9-inch, and certainly no 8.9-4G.
  • The Amazon Prime content which makes the Fire/Fire HD an especially attractive option in the US are totally missing.

Let me get one thing out-of-the-way: the prices are amazing. £129/£159/£199 for these specifications and build quality is a very aggressive move by Amazon. Purely because of the price and brand, Amazon will sell a tonne of Kindle Fires1.

It is the content which is the biggest let-down for me. I’m a Prime customer, and have been for as long as it’s been available in the UK. The free shipping is nice, but I’m starting to get a bit disenfranchised by seeing all these new content features (Instant Video and Kindle Lending Library to name two) spring up in the US, but never make it to the UK. Instead we’re encouraged to take out a separate LoveFilm subscription for streaming video. Last time I had an account (about a year ago), LoveFilm’s streaming service was very poor. I know licensing deals are hard, but if Apple can do it, why can’t Amazon with all their retail clout? Even Google offers more than Amazon.

One of the major features touted during the announcement was X-Ray – tap on an actor in a video and get IMDB information about them, such as other films they’ve been in. Will this work in the UK if I’m using LoveFilm? Somehow I doubt it. The book-related X-Ray features should work at least.

This may all sound like nitpicking over something which is only part of the wider story. Surely having a high-quality tablet at this low a price is an amazing achievement in itself? Well, yes. I wouldn’t take that away from Amazon. I still can’t believe the price. But at the end of the day, the reason the Kindle Fire exists is to sell content. The hardware is so cheap because Amazon can make up the lost margins with the sale of content. The Kindle Fire is a fancy store front on top of Amazon’s services. It’s a strategy which could work… but I can’t help but feel it would be more of a “sure thing” if there was a consistent content strategy across all markets they’re selling the Kindle Fire. As it stands, the only reason to buy the Kindle Fire in the UK is because it is cheap… and experience has taught me you get what you pay for.

  1. Personally I think they’ll sell more of the old Kindle Fires than the HD, purely because it’s so similar, and cheaper. I see similar behaviour with the Kindle eReader. By far, the most common one I see on my commute is the cheapest model. 

Setting Up PHP (The Right Way*) on OS X

* By “The Right Way”, I mean following the guidance and practices at the PHP: the Right Way website. I make no claims this is the “best” way :-)

Works n my machine badgeMac OS X is a pretty good web developer OS. It comes as standard with PHP, Ruby and Apache all out of the box, and the underlying UNIX system makes it easy to add in other languages and components to suit your needs. On top of that, some of my favourite development tools are on the Mac, so unless I’m writing .NET code, nearly all my development is on an (ageing) Mac Mini.

Now, while all that stuff comes as standard on OS X, lately it seems Apple has made it harder to get to. The versions shipped with OS X also tend to be a little behind the latest releases. As a result, most Devs I know use something like MAMP to make the server-side of their environment as easy as running an app. Personally, while I think MAMP works, and is a good time-saver (and I’ve been using it for the last year or so), but I like to get into the nitty-gritty of the system and get things running “native”. So last night I fired up the terminal and got PHP set up on my Mac with the latest version, and following the Right Way Guidelines. As a result I have PHP 5.4, Composer, the PHP Coding Standards Fixer, and MySQL all setup quite slickly (i.e. to my preferences).

The whole process was pretty easy, but does involve the command line. If this makes you uncomfortable, then it might be best to skip the rest of this post.

This all worked on my Mac, but I make no guarantees about it working on yours, and I’m not responsible if you break something.

If you find any glaring problems with this guide then leave a comment/get in touch, and I’ll make any required edits.

Step 1: Setup Your PATH

Edit the hidden .bash_profile file in your home directory. If you use Sublime Text 2 you can use the following command:

    subl ~/.bash_profile

TextMate has a similar mate command, or you can use vi(m)/nano/emacs/whatever.

It’s possible you already have a line defining your PATH variable. It’ll look something like export PATH=<something>. I’ve found it most useful to change the PATH so /usr/local/bin is at the start, making sure anything you install there is used over the system defaults in /bin. Add this as a line below your existing PATH definition (or just add it in, if you don’t have an existing line):

    export PATH=/usr/local/bin:${PATH}

Step 2: Install Brew

Strictly speaking, Brew (aka Homebrew) isn’t required, but I used it to install MySQL later, and it does make it stupid easy to install stuff into OS X. I think you should install it. The best instructions are found on the Homebrew home page, so go have a read there. There are a few pre-requisites, but nothing too difficult.

Step 3: Install PHP-OSX

Now we’re beginning to get somewhere! PHP-OSX is the latest versions of PHP compiled for OSX by Liip. Installation is a real doddle, from the command line:

    curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4

Follow the prompts given, including entering your password. After a few moments everything will have installed. For convenience I created a symbolic link to the newly installed PHP binary in /usr/local/bin:

    ln -s /usr/local/php5/bin/php /usr/local/bin/php

Step 4: Install Composer

Now we have PHP installed, it’s time to look at the nice-to-haves, like a good package/dependency manager. Composer is relatively new on the block, and allows others to download your code and automatically grab any dependencies by running a simple command.

You can install Composer in your project, or you can install it globally. I prefer globally. As with PHP, installation is simple, from the command line:

curl -s http://getcomposer.org/composer.phar -o /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Step 5: Install PHP Coding Standards Fixer

Another nice-to-have, this little tool will try to find and fix parts of your code where it does not conform to one of the PHP Coding Style Guides. Installation is almost identical to Composer:

curl http://cs.sensiolabs.org/get/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer
chmod +x /usr/local/bin/php-cs-fixer

Step 6: Install MySQL

If you installed Brew in step 2, then you’re good to go with this little command:

    brew install mysql

It’ll take a few minutes, but you shouldn’t need to intervene at all. Once done you will need to run two more command to setup the MySQL tables:

    unset TMPDIR
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

If you didn’t install Brew, then you will need to install MySQL through some other means, such as packages on the MySQL website. I can’t help you with that, I’m afraid.

For managing MySQL, I use the excellent Sequel Pro, which is a successor to the venerable CocoaSQL.

As a next step you should look into changing the root password of your MySQL setup. This is a local dev environment, and likely only used locally by yourself, but it’s the proper thing to do.

Bonus Step 7: A Script for Launching MySQL and the PHP Dev Server

To make things a one command startup I wrote myself a little bash script. Now, I am under no illusions this is improvable; it’s my very first bash script (ever), so probably not the “right” way to do this. It’s in a public repo, as well as the public Gist below, so if you want to improve it, feel free! Anyway, it’s functional for now and will start the PHP development server on the port you specify, and set to the (optional) directory, otherwise it will use your current working directory.

To install, run these commands:

    curl https://raw.github.com/chrismcabz/phpsrv/master/phpsrv.sh -o /usr/local/bin/phpsrv
    chmod +x /usr/local/bin/phpsrv

Usage is straightforward:

    phpsrv 8000 #start on http://localhost:8000 in the current dir
    phpsrv 8000 ~/projects/mysite/ #start on http://localhost:8000 in ~/projects/mysite/

Errata

  • Pear doesn’t seem to work, which is slightly annoying, but (to me) no real biggie. I didn’t test this with the built-in version of PHP, so I don’t know whether it worked beforehand. I’ll post an update once I figure it out.
  • I’d like to make bash script smart enough to stop MySQL when the PHP web server stops, but my early attempts haven’t managed to get this working (most likely due to the Ctrl-C used to stop the web server also stopping the script).
  • Throughout this process we’re running scripts directly from the web. This is pretty risky behaviour, especially with unknown/untrusted sources. You should always take a look at the raw script before running it, so you don’t get hit by something malicious.