Stirred bits

Stirred toughts from a shaken entrapreneur.

Rubymotion Completion With Emacs

| Comments

Rubymotion is a great alternative for iOS apps development using ruby without XCode.

It comes with a nifty rake task for generate tags, wich are very useful for code completion when we are using our favorite editors.

Unfortunately the output file is for VIM, but you’re lucky because the fix for getting it work with Emacs is quick and easy.

All you have to do is add the line ‘-e’ at the end of the file /Library/RubyMotion/data/bridgesupport-ctags.cfg

That file contains the options passed to ctags command, -e is for output in emacs format.

Here is the gist just for reference:

Try to execute

1
rake ctags

in your rubimotion project directory, and this time you should see a file named TAGS (in capital letters).

For completion in emacs just press M-. The first time it should ask for TAGS file location.

Enjoy coding with ruby and may the church of Emacs bless you ;)

How to Change a Git Submodule URL

| Comments

Let me save you some headache today: if you’re like me, you really do like keeping your git repo neat and clean using submodules for third party libraries. (Especially if the language you’re using doesn’t have something like CPAN or rubygem)

Everything runs perfect untill you have to change one submodule URL.
For istance: your submodule is a github repo and you can’t wait for your pull request to been accepted, so you press the fork button and commit the patch in your private repo. Now what?

Let ‘yourproject’ be your git working directory, ‘supercoolib’ the submodule and ‘yourusername’ your github username. Open with an editor of your choice (in my case emacs) the .gitmodules file (usually is located at the root of the repo):

1
2
$ cd yourproject
$ emacs .gitmodule

You should see something like this:

[submodule “supercoolib”]
path = lib/supercoolib
url = https://github.com/anotherusername/supercoolib.git

Change the url of the repo like that:

[submodule “supercoolib”]
path = lib/supercoolib
url = https://github.com/yourusername/supercoolib.git

Now tell git to update his internal reference:

1
$ git submodule sync

And then init(if you didn’t already) and update the submodules:

1
2
$ git submodule init
$ git submodule update

Don’t forget to checkout the branch inside the submodule (remember? submodules have a detached HEAD):

1
2
$ cd lib/supercoolib
$ git checkout master

Check if everything is working and finally commit your changes ;)

Book Review: Programming iOS 4

| Comments

“Programming iOS 4” by Matt Neuburg is the best book about iOS SDK out there.

If you find yourself lost in the official Apple documentation, this book can be your final glimmer of hope.
The book is intended for intermediate programmers that already has some notions about OOP and, at least, a little of experience with C.

The book is divided in 6 section:

  • The first section begins with a providential revise of basic C syntax (trust me, you need it, especially if you too accustomed to an high-level language). The other chapters in this section are dedicated to a basic OOP introduction and finally to an in-depth analysis of obj-c syntax.
  • The second section is an introduction to XCode. It explores the tools for debugging, getting documentation and design the GUI for the app. Next it explains how to get a developer certificate to sign apps and run them on real devices, and what are the procedures to follow if you want to get published in the App store.
  • The third sections is about Cocoa. It shows the basic types used around the framework and how to manually manage the memory (in iOS 5 the new mechanism, ARC, allows a semi-automatic management). Then it illustrates the major design-patterns you need to understand, once you got them it’s all downhill.
  • The 4th part it’s all dedicated to views and animations. My suggestion it’s to skip that on first reading of the book because it’s really tough to get for a novice.
  • The 5th part presents the basic controllers. You really need to understand this part before starting to write apps. However I have to admit the ViewControllers are covered best in other books I read before.
  • The 6th part is definitely the worst. It explores some common frameworks in the sdk, but often it’s very superficial and useless. I suggest to completely skip this section and read about frameworks in their official documentation.
  • The last part is indeed one of most useful: it covers basic networking, threads and asynchronous programming, json and xml parsing.

Definitely a must have for every iOS programmer, I can’t wait for the next edition.

Score: 4/5

Embracing Imperfection

| Comments

The first lesson I learned as a startupper is “getting things done”. It’s easy to say, but hard to do so.

The first things you are gonna deal with is that your personal preference in matter of framework, programming language and paradigms, usually doesn’t fit well with the rest of the team in terms of skills, taste, etc..
In Metwit I rember the first dispute on this kind of topic was over the choice of framework which we would have used for rewritten the old php backend. I was (I am) a great ruby fan, so naturally I tried to encourage the adoption of Rails. My team all agreed that we should use a Geospatial database.
Long story short: Django framework has in mainline a project called Geodjango and we finally decided to go with that, for the sake of maintainability. Turns out that it is far from perfect and a huge bottleneck.

The second thing you are gonna deal with is legacy code.
When I joined Metwit my first job was to resume the development of the iPhone app. It was the first obj-c project of a young developer that then lefted the team. As you can well imagine, the code was bloated and it had tons of bugs. At the time I had two choices: a huge refactor or a complete rewritten of the project. I choosed the first.
Turns out that few weeks later our application to SeedStartup incubation was accepted as long as we could provide an early demo. I could never finish a from scratch project in time, somy choice was right.

The last thing you’re gonna deal with is your personal standards and exceptations.
Doing an excellent work is always a matter of time. Time is most precious resource in a startup. Competitors are breathing down your neck. Shit happens every day. Finally you realized that you should have shipped your work yesterday. You’re fucked.
So my advice is lower your exceptations, ship often and early, listen to your custumers and be ready to pivot fast. (Check out this book if you want to learn about Lean Startup principles)

TL;DR Learn to deal with imperfection or you’re never getting things done.

Hello, World!

| Comments

Yeah, I know: the post title is over-used. But I like traditions.
So… I’m Simone, 21. Currently I work at Metwit as COO.

I used to be a blogger, but then I took an arrow to the knee.
As a new year’s resolution I promised myself to resume my writing job.
After struggling for a while, finally I came up with a cool name for the new one… and here we are.

I like books, movies and all the IT stuff. I know when the narwhal does bacon.
Hope you’ll enjoy the show.