Entries Tagged as 'Javascript'

Installing and Getting Started with DocPad on Windows

Javascript , Static Site Generation 2 Comments »

This blogpost is written in the context of using DocPad with No Skeleton and the ECO (Embedded CoffeeScript Templates) templating engine.

Whilst contributing to the Adobe open source project Topcoat.io I had the chance to get up close and personal with DocPad.

DocPad is a next generation web architecture; allowing for

  • Content management via the file system
  • Rendering via plugins, and
  • Static site generation for deployment anywhere.

It's built with Node.js and Express.js, making it naturally fast and easily extendable.

During my time using DocPad I had some issues which I was able to easily overcome so I thought I would document these here so that other in the same position can hopefully find my blog and save themselves some time by trying out these possible workarounds and get to know and use DocPad as it truely is a great toolkit for any web developer looking to get their hands dirty with static site generation.


Definition of a Function vs Method

ColdFusion , Javascript , Misc No Comments »

After a recent discussion as to the correct terminology to use when referring to code written in CFCs I've decided to share my opinion so people have a general idea as to what is meant when someone is referring a function or a method in its simplest sense. 

  • A function is a piece of reuseable code that is called by name.  It can be passed data to operate on (arguments / parameters) and can optionally return a result.
  • A method (also known as a property method) is a piece of code that is called by name that is associated with an object.  A method is almost identical to a function but it's purpose is generally to operate on the data contained within the component (class).

For example, in JavaScript, methods are defined as object properties that contain a function() whose intent is to operate on the data within that object.  Whereas an example of JavaScript functions would be built in global functions such as isNaN(), alert() or user defined functions function debugLog( content ){ console.log( content ) }.

Likewise, in ColdFusion, you could probably say that UDFs (User defined functions) and the standard built in functions provided by ColdFusion are "functions" and the functions within CFCs are methods.

I'm sure people have their own opions on this but in general that's how I like to refer to functions or methods.


Bookmark and Share

jQuery Textarea NobleCount Plugin Addition - Prevent Paste

Javascript , jQuery 2 Comments »

Firstly, thanks to Jeremy Horn A.K.A. The Product Guy for the jQuery NobleCount plugin.

I've had to use it recently and found it to be quite good, so I've decided to contribute back also.  Nothing much but a possible addition for preventing users from pasting charaters into the relevant textarea and bypassing the keyboard events. See below:


Festive Blog Addition

Javascript , Misc No Comments »

If you haven't noticed already...

In the run-up to Christmas, I thought it would be nice to add some festive cheer to the "Homepage" of my blog!

For some reason my preference was to add Christmas lights over any other potential effect.  So here it is.

These lights don't just flash either, you can also smash them with your mouse pointer and alter their size.

To alter their size, simply append any of the following options to the URL:

  • ?size=pico
  • ?size=tiny
  • ?size=small
  • ?size=medium
  • ?size=large

NOTE: There are sound clips used when smashing the lights so please ensure your speaker volume isn't too high (especially if you're in the office!!).

Credit: schillmania.com



Bookmark and Share

Installing CouchDB on Windows (Quick Guide)

Apache CouchDB , Javascript 8 Comments »

Apache CouchDB

Seeing as everyone else out there except me (and a few others) uses a Mac, I thought I'd write this short post regarding installing CouchDB on Windows and how to access the Futon Administration console.

Apache CouchDB is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript. CouchDB also offers incremental replication with bi-directional conflict detection and resolution.

As promised, the quick and dirty way to install CouchDB on windows is as follows:

  1. Click here to visit the Wiki and download the installer.  At the time of writing the latest installer was v1.0.1
  2. When downloaded, run the installer as an "Administrator" and follow the on-screen instructions.
  3. To install couchDB as a Windows Service, leave the default selections as it's automatically configured to do so.
  4. Once the installation is complete, for the default installation options, the service "Apache couchDB" should be running under the local system account.
    1. If, after installation you are experiencing permissions issues, see here.
  5. Open a modern web browser, in otherwords Firefox (this is also the recommended browser to use).
  6. Navigate to:
    1. You should see the following text: {"couchdb":"Welcome","version":"1.0.1"}
  7. To access Futon (Administration console) Navigate to:
  8. That's It !!

Told you it was a quick guide ;-)

I will be exploring couchDB further in the near future and will post my experiences here for anyone else who is interested.

In particular, I'll be looking at:


Bookmark and Share
Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds