Archive : Uncategorized

RSS feed

Getting dovecot running on Mac OS X

Follow this article Open /usr/local/etc/dovecot/conf.d/10-auth.conf Change the mail_location like so mail_location = mbox:/Users/YOURUSERNAME/mail/%u:INBOX=/var/mail/%u 3. Run this command. sudo chgrp /Users/YOURUSERNAME/mail mail

How to create a singleton scaffold in Rails 4

I thought I would quickly post this. Use the usual command to generate the scaffold. rails generate scaffold Model then in routes.rb   Change resource :models to resource :models, :path => ‘model’

How to programmatically assign a category to a post on WordPress

Another quick little snippet. This is when you use it in a loop. $my_post = array(); $my_post['ID'] = $post->ID; $catarray = array(31); // 31 is the cat ID you want to assign foreach((get_the_category($post->ID)) as $category) { array_push($catarray, $category->cat_ID); } $my_post['post_category'] = $catarray; wp_update_post( $my_post [...]
© 2012 Suhas Tech. All rights reserved.
Proudly powered by Wordpress.