Install Postgres on Mac

Postgres is increasingly viable database system.  With Postgres 0.9.x or above, it introduced some amazing features where we can run complex SQL queries.

For web development, you can use any database servers like SQlite3, mySQL, and Postgres. At my work, I need to install Postgres on my MacBook Pro in order to run the web application. Homebrew has a package for postgres where it promises the installation will be breezy.

Install Postgres through the Homebrew.

brew install postgres

Once it is successfully downloaded, compiled, and installed. You will need to setup the initial database first.

initdb /usr/local/var/postgres -E utf8

Then you need to copy the postgres’ plist file to LaunchAgents folder.

cp /usr/local/Cellar/postgresql/{VERSION}/org.postgresql.postgres.plist ~/Library/LaunchAgents/homebrew.mxcl.postgres.plist

Note: change {VERSION} to current postgres version.

Now, you can manually start Postgres server using OSX’s launchctl.

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgres.plist

Or you can use nifty lunchy gem - a wrapper for OSX’s launchctl tool.

gem install lunchy
lunchy start postgres

Create your new database.

createdb $USER

Connect to your postgres server.

psql

If you are running into an issue about unable to connect the postgres server even your postgres server is already running? I have scoured over many stackoverflow solutions, but can’t find the one to work on my end. Until I found this helpful article about PATH environment.

# edit ~/.bashrc or ~/.bash_profile
export PATH="/usr/local/bin:$PATH"

Bam! my createdb or psql command worked! Why? because my psql was from /usr/bin path. Homebrew installed executable commands to /usr/local/bin. We need to tell PATH to look at /usr/local/bin first before /usr/bin.

If you don’t want to install and setup the postgres server. There is a Postgres Server App for Mac. It claimed that it is easiest way to run postgres on the Mac. Install and double click. That’s it.

Postgres Weekly is a weekly newsletter for everyone who wants to catch up with news, technologies, and tips and tricks. Check it out!

taitems:

iOS Inspired jQuery Mobile Theme
jQuery Mobile doesn’t deviate far from the pattern established by its sibling libraries: provide something that normalises functionality and/or design across browsers and operating systems. 
The work by the Filament Group has been vital for standardising the look and feel of jQuery Mobile, especially when dealing with incredibly dated or under-featured mobile browsers. Borrowing upon conventions established by both the iOS and Android operating systems, they created something that is palatable across a range of devices.
There will be odd instances when you need an application to look as close to native as possible. I completely agree with the Filament Group’s arguments against this, but currently designers are forced to roll their own solution. What I have created is the beta framework for an iOS-inspired theme that attempts to bring jQuery inline with the native iOS UI elements. I actually began this project when the first alpha was released, but with taking on a new job and other responsibilities, I found myself lagging behind the release schedule. I’m not sure of the response this will get, so hopefully I can gauge how much time I should spend on this in future.

But without further ado: here is the iOS-inspired theme for jQuery Mobile. It works great in Chrome, Safari, iPhone and iPad mobile Safaris.
  
Some Caveats
To achieve the look of the iOS style back button with CSS3, the HTML is customised and therefore must be copied and pasted manually. The back button template can be found in the GitHub readme file.
The CSS3 back button isn’t perfect, there are some jaggedness and shadow issues.
Plenty of elements still remain unstyled, or are missing hit state styling.
Cross browser compliance is a low priority.
This is an add-on theming layer. It was impossible to fork the actual jQuery Mobile theme and attempt to keep up with their changes, so this just sits as a skinning layer on top.
Some Issues This Exposes in jQuery Mobile
Dialogs need some serious work. I could have spent a lot of time and made my dialogs look exactly like the iOS ones, but this would have involved some pretty hectic CSS and JavaScript. As is I had to do a bit of a work around to get them to dock to the bottom and not the top. Most notably broken, the inability for these dialogs to behave like modals - showing the background as obscured.
Back button syntax. They’re are definitely some cleaner ways to create the iOS style back buttons. I was keen to avoid images, but an image mask might have done really well in this situation. Regardless of that, you will probably find yourself plugging in custom HTML when working with jQuery mobile, and not just the buttons.
It’s bloody hard to keep up with the release cycle. This is not a bad thing ;)
I am, as always, open to merging pull requests and suggestions to help improve this project. I must also stress that it is important that truly innovative changes best be held off until jQuery Mobile makes it out of beta.

taitems:

iOS Inspired jQuery Mobile Theme

jQuery Mobile doesn’t deviate far from the pattern established by its sibling libraries: provide something that normalises functionality and/or design across browsers and operating systems. 

The work by the Filament Group has been vital for standardising the look and feel of jQuery Mobile, especially when dealing with incredibly dated or under-featured mobile browsers. Borrowing upon conventions established by both the iOS and Android operating systems, they created something that is palatable across a range of devices.

There will be odd instances when you need an application to look as close to native as possible. I completely agree with the Filament Group’s arguments against this, but currently designers are forced to roll their own solution. What I have created is the beta framework for an iOS-inspired theme that attempts to bring jQuery inline with the native iOS UI elements. I actually began this project when the first alpha was released, but with taking on a new job and other responsibilities, I found myself lagging behind the release schedule. I’m not sure of the response this will get, so hopefully I can gauge how much time I should spend on this in future.


But without further ado: here is the iOS-inspired theme for jQuery Mobile. It works great in Chrome, Safari, iPhone and iPad mobile Safaris.

  

Some Caveats

  • To achieve the look of the iOS style back button with CSS3, the HTML is customised and therefore must be copied and pasted manually. The back button template can be found in the GitHub readme file.
  • The CSS3 back button isn’t perfect, there are some jaggedness and shadow issues.
  • Plenty of elements still remain unstyled, or are missing hit state styling.
  • Cross browser compliance is a low priority.
  • This is an add-on theming layer. It was impossible to fork the actual jQuery Mobile theme and attempt to keep up with their changes, so this just sits as a skinning layer on top.

Some Issues This Exposes in jQuery Mobile

  • Dialogs need some serious work. I could have spent a lot of time and made my dialogs look exactly like the iOS ones, but this would have involved some pretty hectic CSS and JavaScript. As is I had to do a bit of a work around to get them to dock to the bottom and not the top. Most notably broken, the inability for these dialogs to behave like modals - showing the background as obscured.
  • Back button syntax. They’re are definitely some cleaner ways to create the iOS style back buttons. I was keen to avoid images, but an image mask might have done really well in this situation. Regardless of that, you will probably find yourself plugging in custom HTML when working with jQuery mobile, and not just the buttons.
  • It’s bloody hard to keep up with the release cycle. This is not a bad thing ;)

I am, as always, open to merging pull requests and suggestions to help improve this project. I must also stress that it is important that truly innovative changes best be held off until jQuery Mobile makes it out of beta.