Code Examples

  • user warning: Got error 28 from storage engine query: SELECT node.nid AS nid, node_revisions.body AS node_revisions_body, node_revisions.format AS node_revisions_format, node.title AS node_title, RAND() AS _random FROM node node LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.type in ('quote')) AND (node.status <> 0 OR (node.uid = 0 AND 0 <> 0) OR 0 = 1) ORDER BY _random ASC LIMIT 0, 1 in /var/www/jg-soft.com/modules/acquia/views/includes/view.inc on line 755.
  • user warning: Got error 28 from storage engine query: SELECT node.nid AS nid, node_data_field_images.field_images_fid AS node_data_field_images_field_images_fid, node_data_field_images.field_images_list AS node_data_field_images_field_images_list, node_data_field_images.field_images_data AS node_data_field_images_field_images_data, node_data_field_images.delta AS node_data_field_images_delta, node.type AS node_type, node.vid AS node_vid, RAND() AS _random FROM node node LEFT JOIN content_field_images node_data_field_images ON node.vid = node_data_field_images.vid INNER JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_node term_node2 ON node.vid = term_node2.vid AND term_node2.tid = 41 WHERE (node.status <> 0 OR (node.uid = 0 AND 0 <> 0) OR 0 = 1) AND (node.type not in ('project')) AND (node_data_field_images.field_images_list <> 0) AND (term_node.tid = 13) AND (term_node2.tid IS NULL) ORDER BY _random ASC LIMIT 0, 1 in /var/www/jg-soft.com/modules/acquia/views/includes/view.inc on line 755.

Here you can find a list of code examples. Most are just documented functions. This is becoming my sort of personal code documentation repository. However, some examples have file attachments that you can download. All code exposed here is free and can be used without permission. No warranty is implied, but if you have questions about something, feel free to ask by posting a comment.

  • Emergent Task Timer

    The Emergent Task Timer is a very handy little stand alone flash application that helps you keep track of your time as you develop.

    Features:

    1. Slots to track individual tasks
    2. Bubbles representing 15 minute intervals. Every 15 minutes you click one correcponding to the task you're currently working on.
    3. A small alarm bell that rings every 15 minutes.
  • Send SSH Keys

    Use this command to send your public ssh key to a remote server in one line

    cat ~/.ssh/id_dsa.pub | ssh someguy@somesite.com "cat - >> ~/.ssh/authorized_keys"

  • Separate Email Addresses

    This is a quick script to diff two files which contain email addresses putting the emails in file A which do not exist in file B into file C.
  • Javascript Ajax Form Submitter with Validation using Jquery

    This is an example of an ajax form with nice javascript validation. It is nice because it is object oriented and cleanly separated from the global namespace. It uses jquery to do the heavy lifting and thereby makes the code even easier. It contains a good example of email validation as well.
  • SliderCarousel

    This is an object that makes use of jquery to create a carousel with a nice sliding effect between slide transitions. I've included examples of the html it needs to work and the initialization of it.