Jourdein

I code, I experienced, I blog and I share my enthusiasm

RSS
people

Cross browser styling for inline-block

IE does support inline-block css styling but to which the elements are natively inline. Apply inline-block styling to strong, spans and ems.

But there’s another thing. If hasLayout is triggered on a block element, and then set that element to display inline, it will automagically become an inline-block in IE. However, you must do a *property hack to hide the display:inline from non-IE browser.

display: inline-block;
zoom: 1;
*display: inline;
No Comments | Tags: , , ,

I tried Git

images-1.jpgCurrently, I hosted my repositories with XP-Dev that utilize Subversion as it’s source code management system (SCM). Hearing a lot of hypes about the Git, I did try setting up a git account at Project Locker.

images-3.jpgYep, it seems that Git is really is an advance SCM. It has a lot of features. What differentiate it from Subversion is it’s decentralize repository system. Rather than recreate the post, you can read it at Why you should switch form Subversion to Git.

images-2.jpgOn Mac, if you’re using git, there an open source Git UI called GitX. It trying to utilize the advance features in Git producing such an interface. You have a history graph which I’ve never seen in Subversion UI yet. After you commit, you can see which file and which line has been merges/changes rather than executing command diff.

When you first checkout, you are cloning form the main repository. Thus, when you are in offline mode, you can still commit or revert to previous revision. When you online, push it the server and it will merge with other repo.

Frankly, I would love to convert to Git but project-wise, Subversion can still do what Git can do since my project is not so big and with small team. Moreover, Git is complex because of features it has while in Subversion, I just need to commit or update and does not worry about commit, push and branch merging etc.

No Comments | Tags: , ,

Software Is Hard

Developing software is hard. Below is an article form August 19, 2007.

Software is hard

Really, developing software is hard. If you want all those nifty features, biasing to certain framework because it’s the best, feeding your preference for certain os and without final decision. Yes, if all of those are free then go for it. In reality, those are cost. What languages you gonna use and how many developers you have? What are their expertise?

Some need to be compromise in order to benefit others or to maintain balance.

No Comments | Tags: , ,

Submitting app to App Store

images.jpgReally… it was really a tricky tasks making sure that your app is codesign correctly and Apple website accepted your app. As I could remember, I repeat myself more than 7 times doing the same thing, making sure that I did the steps correctly or when changes require you to start from the beginning.

In a simple understanding flow of process, you need to:

1. Create a request for certificate
2. Install the certificate
3. Create App Id
4. Create Provisioning profile
5. Download Provisioning profile
6. Setting XCode to CodeSign using the certificate.
7. Get the binary file, zipped it and upload to Apple website.

So, your target is to get the binary file (.app). That .app file must be signed by XCode using certificate given by Apple. The signing process also requires that you have a valid provisioning profile which you get from Apple, generated from the certificate you’ve requested.

No Comments | Tags: , ,

ForkLift 1.7 crashed on Snow Leopard

forklift.pngI’ve install ForkLift 1.7 and suddenly, it crashed. Examining the report that is supposed to be sent to Apple, I found that, ForkLift is trying to access some of the files that aren’t there.

Googled and found that the files has been placed under a different folder in Snow Leopard. Logical thinking, the files are there but ForkLift doesn’t know where they are.

Found a fix that restore those file references by creating symlinks:

sudo ln -s /System/Library/Frameworks/AppleShareClientCore.framework /System/Library/Frameworks/AppleShareClient.framework
sudo ln -s /System/Library/Frameworks/AppleShareClientCore.framework/Versions/A/AppleShareClientCore /System/Library/Frameworks/AppleShareClientCore.framework/Versions/A/AppleShareClient
sudo ln -s /System/Library/Frameworks/QuickLook.framework /System/Library/PrivateFrameworks/QuickLookUI.framework
sudo ln -s /System/Library/Frameworks/QuickLook.framework/QuickLook /System/Library/Frameworks/QuickLook.framework/QuickLookUI
sudo ln -s /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLookUI

Run the above commands in terminal. If you have problem copying and pasting, download it here. Execute the file from terminal either by

$ ./fixsymlinks

or

$ source fixsymlinks

From whom did I get the solution… Zolntanb (thanks mate)

No Comments | Tags: , , , ,

Google is phasing out Microsoft internet Explorer 6

ie6trash.png Google will begin phasing out support for IE6 and other older browsers on Google Docs suite and Google Sites editor on March 1. I’ve received the notices since I’m an admin for Google Apps.

Seems that, somewhere in 2010, Google Apps will continue to support IE7 and above, Firefox 3.0 and above, Google Chrome and above and Safari 3.0 and above.

Since Google has forgotten IE6, it would also be natural for me to forget IE6. My life would be easier developing website without worrying how it will render on IE6 or IE5.

Google said that they want to harness latest improvements in web browser technology and it would be HTML5 and faster Javascript. Google has their experiment on this technology and it was mind blowing experiences. And mind you, IE is not welcome there. It mainly targeted for Chrome browser but Firefox and Safari can view correctly but not IE (I’ve read some comments there about this). Head to Chrome Experiments to see for yourself.

No Comments | Tags: , ,

Updating a has_many relational model

has many relationship solution.png

Last night, found a problem in codes during updating form for a has_many relationship model. Rather than updating the record, it created a new one.

The solution is in railscasts episode 75.

Consider contact that has_many contact_email addresses. Created

def contact_email_attributes=(contact_email_attributes)
  contact_email_attributes  do |attributes|
    contact_emails.build(attributes)
  end
end

Changed to this one:

def contact_email_attributes=(contact_email_attributes)
  contact_email_attributes.each  do |attributes|
    if attributes[:id].blank?
      contact_emails.build(attributes)
    else
      contact_email = contact_emails.detect { |e| e.id == attributes[:id].to_i }
      contact_email.attributes = attributes
    end
  end
end

that will updates contact_email if there’s :id attributes. Then, I need to add the :id inside the form as hidden_field_tag:

- @contact.contact_emails.each do |contact_email|
...
= hidden_field_tag "contact[contact_email_attributes][][id]", contact_email.id
...

And that’s all. It’s done.

In the form, you could do fields_for rather than using _tag methods. In fact, my original code was using that but after I tried everything and it ended up with the _tag methods, I was lazy to change it back. By the way, it works both ways…

No Comments | Tags:

Passenger, Rails and XAMPP on Mac

I’ve successfully setup my Rails on Passenger. It was not a swift tasks as I was trying to setup it on ‘my’ XAMPP.

I had XAMPP all the way since I’ve started development on PHP. Don’t want to install different Apache server just to setup Passenger. Because of that, I took 1 full day of my life to finally have a functional Rails with Passenger on Apache in XAMPP.

(assuming you had Rails with Mongrel and XAMPP already)

  1. Install gem Passenger
  2. Download XAMPP dev (this is the key for success!)
  3. Run passenger install script
  4. Modify Apache .conf file

(you’re ready to go)

Add some miscellaneous (that’ll make your life easier)

  1. Download and install Passenger Preference Pane

1. Install gem Passenger

$ sudo gem install passenger

2. Download XAMPP Developer

XAMPP Developer package for Mac

3. Run passenger install script for Apache

$ sudo passenger-install-apache2-module

(No. 4 step is given at the end of module installation above)

Download & install Passenger Preference Pane here

No Comments | Tags: , ,

Hosting server migrated

legal-bytes.com was down and at the time of posting, it’s still down. I’ve just waiting for the domain changes to take effect.

I thought, it was the problem related to the server and that I just need wait until it is fixed. It was down for 3 days (approximately) that I took the liberty to send a support ticket to Exabytes‘ support engineer. Immediately (not hour or even half an hour), they replied with the explanation:

For your information, the server 210.48.145.6 already migrate to the new data center and we have update the IP to 110.4.45.29

legal-bytes.com didn’t use their DNS records but just pointing the A record to the shared IP address associated with our hosting package. For that matter, I think, the update of the IP didn’t automatically configured to the domain and thus need the domain administrator to change it manually.

I was very very happy with Exabytes for the services they’ve given. Recommended if you are finding one.

Updates
Did asked if the old DNS still applied and the answer is “not anymore”. It has changed to

Old

ns67.mschosting.com 210.48.145.7
ns68.mschosting.com 210.48.145.8

New

ns101.mschosting.com 110.4.45.4
ns102.mschosting.com 72.18.132.245

No Comments | Tags: , ,

Learning Ruby on Rails for 2 weeks

I’m really tired. It has been a hectic weekend for me. Code code and more code. Learn Rails in two weeks while developing application at the same time. Today, I think I’ll stop here. The system seems O.K. I would like to enjoy my weekend left.

No Comments | Tags: , ,