Our Command through simplicity blog

Jan 14, 2011

How to get display name from NSScreen

While working on Wallpapery I needed to get a given screens display name. There is no “displayName” method on NSScreen so I added a category to provide this functionality. Seems like others are looking for this too so I’m posting my code below. NSScreen+DisplayName.h #import <Cocoa/Cocoa.h> @interface NSScreen (DisplayName) - (NSString *)displayName; @end NSScreen+DisplayName.m #import <IOKit/graphics/IOGraphicsLib.h> #import "NSScreen+DisplayName.h" @implementation NSScr...

Jan 06, 2011

How to send mass text messages from your own number

A couple of months ago we needed to make a service which would be able to send out sms text messages to a large number of people. The text message itself should come from a specific number so recipients would be able to reply back for more information. Another requirement was the ability to send a text message to a specific number and then trigger the mass sending to the configured recipients. The part sending out bulk sms is easy. A lot of companies have great, simple APIs to do this but t...

Jan 06, 2011

Send your weight from an iPhone through SMS

While working on lifestyleapps I have been asked a couple of times, if it would be possible to report your weight by sending an SMS from your phone. This is already possible and I have been using it from my iPhone 3G for a long time. The trick is to associate your Twitter account to your lifestyleapps account and set up your Twitter to accept SMS. In order to report your weight you need to follow @reporting which is the lifestyleapps Twitter account and by following this (and it will follow ...

Nov 18, 2010

UIModalPresentationFormSheet width and height for an iPad in landscape mode

In a recent application I was doing, I was designing an interface to be shown as a modal form sheet using setModalPresentationStyle:UIModalPresentationFormSheet. I searched the Apple documentation to find the exact dimensions of this sheet but it isn’t documented. It only states “The width and height of the presented view are smaller than those of the screen and the view is centered on the screen. If the device is in a landscape orientation and the keyboard is visible, the position of the vi...

Oct 27, 2010

How to backup Redmine on Google Storage

If you would like to backup your Redmine database and files, you might to consider Google Storage as your backup location. It comes with a 100 GB free monthly usage. First, you need to sign up for a Google Storage account if you don’t have an account already. Once done, download and install GSUtil which is a command line tool, allowing you to manage buckets. Paste the following script into a file called “backup_redmine.sh” # required settings DB_USERNAME='<redmine db username>' DB_...

Sep 02, 2010

Using vi for your simple, day-to-day editing needs

My favorite editor isn’t vi, but I’m still using it at least a couple of times each day. It’s a short two character command, it’s always available and it starts fast. I have used it for decades and still, I only know these commands. I really don’t need to learn any others, contrary what some of my friends tell me. Need to know j = move down k = move up l = move right h = move left i = go into “insert” mode = go into “command-line” mode ESC = go out of current mode x = delete chara...

Aug 25, 2010

Lesson learned: Put limits on anything you provide for free

With our ShoutSMS service, we provide three free sms credits just for signing up. We do this to allow new users to try our service, without having to buy initial credits, just after they sign up. After initial launch, we almost immediately got people from India hitting our servers. They signed up, confirmed their number and tried to send overtaxed sms to various numbers. Because I had chosen an initial credit limit and a max cost limit on each sms, it was avoided. I know from my previous wor...

Aug 18, 2010

Marketing tip: Include link to your app in newsletters

I have registered on a lot of sites and opt-in for their newsletter to be notified of updates. One thing bugging me is, when a site sends a great mail in their newsletter but doesn’t include a direct link to their web site. The mail is coming from their domain so it isn’t hard to guess but users are lazy! Since I’m registered on too many sites to visit regularly, I probably do want to visit a site, if it contains exiting updates but I have to admit, that without a direct link, I might not g...

Aug 16, 2010

Upgraded ShoutSMS from Rails 2.3.8 to Rails 3 in five minutes

Today I wanted to try how easy it would be to upgrade our existing ShoutSMS (pretty small) Rails application from 2.3.8 to latest Rails 3 release candidate (currently rc3). Without taking our test suite into consideration it took around five minutes with help from the official rails_upgrade[1] plugin. This is fast, yes, but considering the size of this app and possible pitfalls I am not looking forward to upgrade our larger projects. These are the basic steps to perform Install rails_upgra...

Aug 16, 2010

Facebook CSS for will_paginate gem

Today I needed to add pagination to our Danish beta application for handling your accounting called Hurtigmoms (defunct). Since we’re developing in Rails it was a logically choice to use “will_paginate” to support pagination. Our prototype layout is using a Facebook header and so I wanted my pagination control to mimick their style. If you need something similar you might want to take a look at my CSS styles which are using the default class names used by will_paginate. .pagination { ...


🔥