-
Pet Projects
Category Archives: General
Found this little gem in Stackoverflow. $(function() { $("img") .mouseover(function() { var src = $(this).attr("src").match(/[^.]+/) + "over.gif"; $(this).attr("src", src); }) .mouseout(function() { var src = $(this).attr("src").replace("over", ""); $(this).attr("src", src); }); }); Thanks to Jarrod Dixon. Here is another simpler version. … Continue reading
The example shows that I sort posts with custom field “Start Date”. I am using ‘meta_query’ to query the custom fields – you can find out more here. $args[’post_type’] = array(’ur_post’, ‘programs_post’, ‘education_post’, ‘blog_post’ ); $args[’meta_key’] = ‘Start Date’; $args[’meta_query’] … Continue reading
Someone (bradgessler) in HN made a very good comment in this thread. I’m just going to copy-paste everything. Source. The biggest problem with today’s REST implementations is that they’re essentially a database serialization layer. Consider how a RESTful Rails model … Continue reading
Okay, I just spent a few days coming up with new look for the blog. It is based on the WordPress + Blueprint Barebones/Skeletal (or whatever you call it) theme. This is still a work in progress and if you … Continue reading
Although, there are more advanced multi-language plugins like qTranslate available, this post will deal with basic translations in your theme. Like for example, if you want to translate a “hard-coded” English strings in your theme. <h1>Programs</h1> … translated into French, … Continue reading
I am posting this for myself and for my brother, John (haha). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head> <body> <style type="text/css"> .Example_F { -moz-box-shadow: 0 0 5px 5px #888; -webkit-box-shadow: 0 0 … Continue reading
It has become my habit that when designing a website, I always use the template that comes with the BlueprintCSS download. I always make sure that my design “fits” BlueprintCSS. I am sharing my WordPress-BlueprintCSS Skeletal Theme. The theme is … Continue reading
For my personal consumption.
Aside from the normal “Add Post” link in the WP-Admin Panel, you can add a custom post type. See http://codex.wordpress.org/Post_Types#Custom_Types. For example, if you want to add “Videos and Podcasts” as another post type, you put this in your functions.php … Continue reading
I got stuck for almost an hour trying to create a multiple select checkbox. Here is how to do it: First, I put this in my forms.py class UserlistForm(forms.Form): users = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple,label="Notify and subscribe users to this post:") Then in … Continue reading