iOS 7 status bar fix for Sencha Touch apps

Sencha Touch hasn’t been updated for iOS 7’s new fullscreen views yet. This causes the status bar to overlap your app’s content, which looks rather messy.

Luckily it’s really easy to get things working again if all your views use title bars / navigation bars.

Just drop this code into app.js (after your last Ext.Viewport.add line) to make the title bars a bit taller and push the title bar’s contents down a few pixels so that the title and any buttons up there don’t collide with the status bar’s contents:

// Adjust toolbar height when running in iOS to fit with new iOS 7 style
if (Ext.os.is.iOS && Ext.os.version.major >= 7) {
  Ext.select(".x-toolbar").applyStyles("height: 62px; padding-top: 15px;");
}

Unadopted Podcast Session 039 Out Now!

A WILD PODCAST APPEARS! It’s been far too long since I did one of these, so here’s a bunch of awesome stuff that I’ve been listening to lately. Music this time from Hot Chip, Metric, Delphic, Tame Impala, Alex Metric, Tensnake and loads more.

  1. Inner City – Big Fun (Simian Mobile Disco Remix)
  2. Niki & The Dove – The Drummer (Fake Blood Remix)
  3. Totally Enormous Extinct Dinosaurs – Waulking Song
  4. Metric – Monster Hospital (MSTRKRFT Remix)
  5. Alex Metric & Jacques Lu Cont feat Malin – Safe With You
  6. Tensnake – Coma Cat
  7. Hot Chip – Flutes (Sasha Remix)
  8. Kölsch – Zig
  9. Alex Metric & Steve Angelo – Open Your Eyes (Style Of Eye Dub)
  10. Grum – Heartbeats (Joe & Will Ask? Remix)
  11. Delphic – Good Life (Lone Remix)
  12. Tame Impala – Why Won’t You Make Up Your Mind (Erol Alkan Rework)

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!

Unadopted Podcast Session 038 Out Now!

A lighter mix than the past few. Music this time from Grum, Cassius, M83, Of Monsters & Men, Two Door Cinema Club and more!

If you love the Unadopted Podcast, please add Unadopted on Facebook and tell your friends about the podcast, then tune into Unadopted Radio! Also, please be good and buy the tracks you like, it’s only a few pence a track these days!

Want to send music in to the Unadopted Podcast? Now you can! Visit the Unadopted Soundcloud and send your music in (it’s dead easy). If I like it, I’ll try and get it into one of the sessions!

  1. The Whitest Boy Alive vs Mylo vs Cut Copy – Otto’s Golden Journey (Andy Webb’s Dreamy Blend)
  2. Two Door Cinema Club – Sleep Alone (BeatauCue Remix)
  3. Buffetlibre – The Sun In The Shade (Bonde Do Role Remix)
  4. Cassius – Feeling For You (Les Rythmes Digitales Dreamix)
  5. Grum – Heartbeats
  6. Farleon – Millenium
  7. M83 – Reunion (Mylo Remix)
  8. Of Monsters & Men – Little Talks (The Knocks Remix)
  9. Ellie Goulding – Anything Could Happen (Alex Metric Remix)
  10. The Knocks & Fred Falke – Geronimo (Louis La Roche Remix)
  11. Bertie Blackman – Black Cats (Shazam Remix)
  12. Harry Thumann – Underwater

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!

Unadopted Podcast Session 037 Out Now!

Just in time to have something to listen to while frantically clicking refresh trying to get tickets for Glastonbury. :) Music this time from Cagedbaby, Van Go Lion, Van She, PNAU, The Migrants and more!

If you love the Unadopted Podcast, please add Unadopted on Facebook and tell your friends about the podcast, then tune into Unadopted Radio! Also, please be good and buy the tracks you like, it’s only a few pence a track these days!

Want to send music in to the Unadopted Podcast? Now you can! Visit the Unadopted Soundcloud and send your music in (it’s dead easy). If I like it, I’ll try and get it into one of the sessions!

  1. Goose – Synrise (Soulwax Remix)
  2. Beach Boys – Good Vibrations (Stanton Warriors Remix)
  3. Lazy Jay – Float My Boat (Extended Mix)
  4. The Bird and the Bee – Fucking Boyfriend (Peaches Remix)
  5. Cagedbaby – Forced (Foamo Remix)
  6. Krafty Kuts – Cassius Groove
  7. Afrojack – Replica
  8. Daft Punk – Prime Time Of Your Life (Tits & Clits Remix)
  9. Van Go Lion – Glow (Alfa’s Snow White Remix)
  10. Van She – Idea Of Happiness (SebastiAn Remix)
  11. Deadmau5 & Wolfgang Gartner – Animal Rights
  12. The Migrants – I Thought That (Boris Dlugosch Remix)
  13. PNAU – Come Together
  14. Stereofunk – Rage
  15. The 2 Bears – Be Strong

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!

shareit: Simple FTP-based file sharing from the command line

File sharing websites tend to have ads everywhere, and long running HTTP uploads of large files can be a pain in the backside, so I stopped using them a while back. Whenever I needed to share a file with someone, I’d figure out the file’s MD5 sum (to avoid naming collisions), fire up Transmit (the nicest Mac FTP app by far), upload the file, rename it after uploading, then manually type the link and copy/paste the MD5’d filename in and send it to whoever I wanted to share the file with.

It was nice because I hosted the files, and didn’t have to worry about my recipient seeing a bunch of ads or the file sharing service going down (or being taken down). But it had a huge downside in that it wasn’t straightforward. I was doing a whole bunch of the work by hand every time I wanted to share a file with someone, which as a coder seems like I’m doing something wrong. Eventually I got round to automating it, and now it’s much easier to share a file with someone quickly, just fire one line into the terminal and you’re done.

Getting Started
Before you get started, you’ll want to create a simple YAML file called .shareit in your home directory with your FTP config details, like this:

hostname: ftp.yourwebsite.tld
username: yourusernamegoeshere
password: yourpasswordgoeshere
path: public_html/shareit/
http_prefix: http://yourwebsite.tld/shareit/

path should exist on the FTP server, and http_prefix should be the URL that the folder is accessible at. Both path andhttp_prefix should also include the trailing slash.

Note that the URLs shareit generates are not secure, but they are random enough that people won’t be able to guess them easily unless they know the file’s exact contents. It is recommended that you disable your webserver’s automatic directory indexing for the folder you define in http_prefix — if you don’t, people will be able to browse your entire collection of shared files.

Once you’ve set up your config file, make shareit available in your PATH by adding a symlink in /usr/bin or /usr/local/bin or something.

Usage
Using shareit is simple, all you need to do is tell it what file to upload:

$ shareit 10mb.txt
Uploading to http://yourwebsite.tld/shareit/596c35b949baf46b721744a13f76a258.txt: 10000K of 10000K (100%)
Upload complete!

You can download shareit from https://github.com/arussell/shareit.

Unadopted Podcast Session 036 Out Now!

After 8 months of neglect, the Unadopted Podcast is finally back! Music this time from Goose, Santigold, Hot Chip, Soulwax, Joe Goddard and more!

If you love the Unadopted Podcast, please add Unadopted on Facebook and tell your friends about the podcast, then tune into Unadopted Radio! Also, please be good and buy the tracks you like, it’s only a few pence a track these days!

Want to send music in to the Unadopted Podcast? Now you can! Visit the Unadopted Soundcloud and send your music in (it’s dead easy). If I like it, I’ll try and get it into one of the sessions!

  1. Goose – Synrise (Housemeister Remix)
  2. Santigold – Disparate Youth (The 2 Bears Remix)
  3. Alex Metric – Deadly On A Mission (Dub Mix)
  4. Miike Snow – Paddling Out (Wolfgang Gartner Remix)
  5. Soulwax – Another Excuse
  6. Boys Noize & Erol Alkan – Lemonade (Justin Robertson’s Deadstock 33’s Remix)
  7. Hot Chip – Touch Too Much (Fake Blood Remix)
  8. Alex Gopher – Brain Leech (Bugged Mind Remix)
  9. Para One – Dundun-Dun (Album Version)
  10. Joe Goddard – Gabriel (Soulwax Remix)

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!

Thoughts on switching from Chrome to Safari 5.2 [updated]

I’ve used Google Chrome almost exclusively as my main browser since 2009, but after seeing Apple’s WWDC keynote last week I decided to give Safari another try, because being able to send a tab from one device to another (without using Pastebot to just copy/paste the URL across devices),  is one of my most-wanted features.

Things I like about Safari:

  • iCloud tabs (even though I don’t have Mountain Lion yet, it’s already come in useful between my iPad and iPhone running iOS 6).
  • A unified bookmarks bar between my iOS devices and Safari on OS X
  • Reader (though I used Readability before, so I’m not really gaining anything really new here)
  • A unified address/search bar in Safari 5.2 (FINALLY.)

Things I don’t like:

  • No built-in translator
  • No distinct incognito/private browsing windows (with Chrome, incognito windows are super-useful for having two separate “cookie sets” allowing you to login as two users at once while developing web apps)
  • No pinnable tabs… there are a few things I always leave open, but I don’t want them taking up huge amounts of real-estate on my tab bar
  • More than a handful of tabs leads to Safari just displaying a >> icon at the end of the tab bar, whereas Chrome makes them progressively smaller so you can at least still get to them all
  • In Safari, Cmd-1 through Cmd-9 select Bookmark Bar bookmarks in Safari rather than specific tabs (this means I keep accidentally leaving the page I’m on and calling a bookmark instead of switching to the tab I wanted)
  • Lame process separation in Safari: although the web process is separated from the main browser UI process, if one tab crashes in Safari, ALL tabs need to be refreshed. This is no better than having the entire browser “unexpectedly quit” on me, really.

So far I’m finding Safari’s limitations super annoying and I want to switch back, but I’m going to stick it out a while longer. Perhaps I’ll get used to the quirks.

Update 2012-06-23: I’m back to Chrome. Safari’s funky replacement for the WebKit Developer Tools was the final straw.

Fixing problems caused by using an old version of RubyGems (1.7.2)

I recently had to install an old version of RubyGems (v1.7.2 to work around an incompatibility with a Rails 2.3.x app I’m working with. This caused Capistrano to freak the older RubyGems version out with this error:

Invalid gemspec in [/Users/myusername/.rvm/gems/ree-1.8.7-2012.01@mygemset/specifications/capistrano-2.11.2.gemspec]: invalid date format in specification: "2012-02-22 00:00:00.000000000Z"

This broke RubyGems so bad that every gem (such as the Rails gem) stopped working because RubyGems wouldn’t load. Switching to an earlier Capistrano didn’t help, so I ended up just changing the date manually in the Gemspec (the file listed by the error). I did that by changing this line:

s.date = %q{2012-02-22 00:00:00.000000000Z}

to:

s.date = %q{2012-02-22}

After that, everything started working again. Messing with the Gemspec like that probably isn’t ideal for various reasons, but it got my environment going again.

Update: Yeah, turns out it’s a pain in the backside running with a old version of RubyGems. This problem isn’t just Capistrano, all my gems started freaking out. Solution to that was to nuke all my gems (thankfully I use RVM so it was just a case of rvm gemset gemsetname delete), upgrade rubygems with gem update --system and start over again.

Unadopted Podcast Session 035 Out Now!

The Unadopted Podcast is 5 years old! To celebrate, here’s a new session with a bunch of great music I discovered in 2011. Bit of a mixed bag this one, with some Azealia Banks, Holy Ghost!, Evil Nine, LCD Soundsystem, Zombie Nation, Daft Punk, Ladyhawke, Bag Raiders and much more!

If you love the Unadopted Podcast, please add Unadopted on Facebook and tell your friends about the podcast, then tune into Unadopted Radio! Also, please be good and buy the tracks you like, it’s only a few pence a track these days!

Want to send music in to the Unadopted Podcast? Now you can! Visit the Unadopted Soundcloud and send your music in (it’s dead easy). If I like it, I’ll try and get it into one of the sessions!

  1. Bag Raiders – Sunlight (Armand Van Helden Remix)
  2. The Dukes Of Windsor – The Others (TV Rock Mix)
  3. Ladyhawke – Paris Is Burning (Alex Metric Remix)
  4. Holy Ghost! – I Know I Hear (Jacques Renault Remix)
  5. Only Children – Don’t Stop (Hey Champ! Remix)
  6. Sohodolls – Right And Right Again (Alistair Whitehead Mix)
  7. Daft Punk – Aerodynamite
  8. Evil Nine feat El P – All The Cash (Alex Metric Remix)
  9. Azealia Banks – 212
  10. Sneaky Sound System – Tease Me (Bag Raiders Remix)
  11. Zombie Nation – Overshoot (DJ Mehdi Remix)
  12. Boy 8 Bit – Madrigal
  13. Fake Blood – Deep Red
  14. Siriusmo – Wow
  15. The Presets – My People (The Hump Day Project Remix)
  16. The Goodmen – Give It Up (2011 Edit)
  17. LCD Soundsystem – You Wanted A Hit (Soulwax Remix)
  18. Friendly Fires – Skeleton Boy (Grum Remix)
  19. Caribou – Sun (Unadopted Remix)

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!

Unadopted Podcast Session 034 Out Now!

Yep it’s Monday again, but here’s something to make the week go that bit quicker! Music this time from Tiga, Cut Copy, Carte Blanche, Ladytron, TEED, Eyerer & Chopstick and more!

If you love the Unadopted Podcast, please add Unadopted on Facebook and tell your friends about the podcast, then tune into Unadopted Radio! Also, please be good and buy the tracks you like, it’s only a few pence a track these days!

Want to send music in to the Unadopted Podcast? Now you can! Visit the Unadopted Soundcloud and send your music in (it’s dead easy). If I like it, I’ll try and get it into one of the sessions!

  1. Eyerer & Chopstick feat Zdar – Make My Day (Vocal Club Mix)
  2. Evil Nine – Stay Up
  3. Dada Life – White Noise Red Meat (Original Mix)
  4. Franz Ferdinand – No You Girls (Foamo Remix)
  5. Cold War Kids – Hang Me Out To Dry (Hostage Remix)
  6. Monarchy – I Won’t Let Go (Jaymo & Andy George Remix)
  7. Tiga – You Gonna Want Me (Tocadisco Remix)
  8. Carte Blanche – Gare Du Nord
  9. Urchins – Xylophobe (Grum Remix)
  10. Cut Copy – Lights & Music (Boys Noize Happy Birthday Remix)
  11. Ladytron – Ace Of Hz (Punks Jump Up Remix Radio Edit)
  12. Totally Enormous Extinct Dinosaurs – Garden (Joe Goddard Remix)

Listen now over at http://unadopted.co.uk/podcast/. If you haven’t already set it up, search for “Unadopted” in the iTunes Store and have the latest sessions automatically delivered right into your iTunes Library!