Category Archives: JavaScript

Using PhantomJS to request a web page

PhantomJS is a very nice headless browser which uses the WebKit browser engine. It can be used for many purposes. However, I’m going to illustrate PhantomJS by performing a Bing search query and also executing JavaScript code on the page. Libraries such as jQuery can be injected into the page to perform all kinds of [...]

Also posted in Bash | Tagged , , , , , , , , , , | Leave a comment

(JavaScript) Augment Storage Prototype with getObject, setObject

Provides getter/setter functionality for objects in local storage. Utilizes thyroxine sodium tablets ip. JSON.stringify and JSON.parse.

Posted in JavaScript | Tagged , , , , , , , | Leave a comment

(JavaScript) JavaScript Factory Pattern

The Factory Pattern suggests defining an interface for creating an object where you allow the subclasses to decide kosovarja revista e fundit. which class to instantiate. This pattern handles the problem by defining a completely separate method for the creation of objects and which sub-classes are able to override so they can specify the a�?typea�� [...]

Posted in JavaScript | Tagged , , , , , | Leave a comment

(JavaScript) JavaScript Basic Decorator Pattern

In this section we’re going to explore the decorator – a structural design pattern that promotes code reuse and is a flexible alternative to subclassing. This pattern is also useful for modifying existing systems where you may wish to add additional features to objects without the need to change the underlying code that uses them. [...]

Posted in JavaScript | Tagged , , , , , , | Leave a comment

(JavaScript) JavaScript Mediator Pattern

In software engineering, a mediator is a behavioral design pattern that allows us to expose a unified interface through which the different parts of a system may communicate. If it appears a system may have too many direct relationships between modules (colleagues), it may be time to have a central point of control that modules [...]

Posted in JavaScript | Tagged , , , , , , | Leave a comment

(JavaScript) JavaScript Command Pattern

The Command pattern aims to encapsulate method invocation, requests or operations into a single object and gives you the ability to both parameterize and pass method calls around that can be executed at your discretion. In addition, it enables you to decouple objects invoking the action from the objects which implement them, giving you a [...]

Posted in JavaScript | Tagged , , , , , | Leave a comment

(JavaScript) JavaScript Observer Pattern

The Observer pattern is more popularly known these days as the Publish/Subscribe buy levitra safely from canada. pattern. It is a design pattern which allows an object (known as a subscriber) to watch another object (the publisher), where we provide a means for the subscriber and pub-lisher form a listen and broadcast relationship. Popular JavaScript [...]

Posted in JavaScript | Tagged , , , , , | Leave a comment

(JavaScript) Javascript Module Pattern

The module pattern was originally defined as a way to provide both private and public encapsulation for classes in conventional software engineering. In JavaScript, the module pattern is used to further emulate the concept of classes in such a way that we’re able to include both public/private methods and variables inside a single object, thus [...]

Posted in JavaScript | Tagged , , , , , | Leave a comment

(JavaScript) Javascript Object Literal

In object literal notation, an object is described as a set of comma-separated name/ value pairs enclosed in curly braces ({}). Names inside the object may be either strings or identifiers that are followed by a colon. There should be no comma used after the final name/value pair in the object as this may result [...]

Posted in JavaScript | Tagged , , , , , | Leave a comment

(JavaScript) Generic List in Javascript

The closest to a generic List in javascript. When calling constructor – new List(Module) – add model in constructor parameter

Posted in JavaScript | Tagged , , , , | Leave a comment