I’m using my own UITableViewCells – instead of creating some in IBuilder, because then you have to load them each time from NIB file and it really slowdown your app. So, this is simple example how to do it – TableCell contains only two non-editable labels with text.
Category: programming
Sportka v FMS/MSW Logo
Rails 2.3.8
Rails 2.3.8 just released. Fixing some issues with previously (and fast) released 2.3.6 and 2.3.7 versions. Update your gems :)
$ gem update rails $ gem update --system
refs: http://weblog.rubyonrails.org/2010/5/25/ruby-on-rails-2-3-8-released
NEON: get/post/put requests
iPhone SDK4 Beta 4
Apple has released new version of iPhone OS4 SDK (SDK4) Beta 4…
Build: 10M2252
Download & Availability: iPhone Developer Program/Members only
How to get line number and file of your RoR code
# parse caller to fetch filename, method & line of call def parse_caller(at) if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at file = Regexp.last_match[1] line = Regexp.last_match[2].to_i method = Regexp.last_match[3] [file, line, method] end end
file, line, method = parse_caller(caller(1).first)
Mzdy a penize
Aplikace “Mzdy a penize” pro iPhone jiz v AppStore. Cena 0.79Euro
custom date/time formatting with i18n
in helper
def show_date(date) return '' if date.nil? || date==0 l(Time.at(date), :format => :ddate) end
in config/locale/en.yml (for example)
date: formats: ddate: %d.%m.%Y
add czech pluralize to i18n
module I18n::Backend class Simple protected def pluralize(locale, entry, count) return entry unless entry.is_a?(Hash) and count key = :zero if count == 0 && entry.has_key?(:zero) key ||= count == 1 ? :one : (2..4).include?(count) ? :few : :other raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key) entry[key] end end # class end # module
normalize UTF8 (translit/deaccent)
place this in your application.rb (eg)
class String def translit Unicode.normalize_KD(self).unpack('U*').select{ |cp| cp < 127 }.pack('U*').gsub(/ /,'-').downcase end end