Javascript — Dynamically generating Accessor and Mutation methods

This is a neat trick I picked up the oth­er day, you can cre­ate a dynam­ic class which takes in a set of prop­er­ties in the con­struc­tor and dynam­i­cal­ly gen­er­ates Acces­sor and/or Muta­tion meth­ods (you just have to choose which lines to leave out): In your call­ing code, you can then cre­ate a new class …

Javascript — Dynam­i­cal­ly gen­er­at­ing Acces­sor and Muta­tion meth­odsRead More »

Javascript — Immutable types

In C# and oth­er sim­i­lar gen­er­al pur­pose lan­guages, there are access mod­i­fiers which allow you to spec­i­fy whether a par­tic­u­lar prop­er­ty can be accessed/modified by every­one (pub­lic), only sub­class­es (pro­tect­ed) or only from with­in the same class (pri­vate). In these lan­guages, cre­at­ing an immutable type usu­al­ly involves: mak­ing all prop­er­ties pub­licly get­table mak­ing all prop­er­ties …

Javascript — Immutable typesRead More »

Having fun with HTML5 — Canvas, part 2

Ear­li­er I explored some of the basic draw­ing meth­ods avail­able on the 2D con­text of the new can­vas ele­ment in HTML5, mov­ing on from there, I’ve put togeth­er anoth­er quick demo here (see image below) which lets the user scrib­ble inside the can­vas ele­ment. HTML The HTML for the page is sim­ple enough, the key …

Hav­ing fun with HTML5 — Can­vas, part 2Read More »

Some useful Javascript related links

Gen­er­al wtfjs – all the WTF lan­guage fea­tures asso­ci­at­ed with javascript! Guide to OO basics of javascript   Node.js – home for Node.js npm – a repos­i­to­ry for Node.js mod­ules express – web serv­er frame­work for Node.js drop­box-node – node.js client for work­ing with the Drop­box API hum­ming­bird – real-time (20 updates per sec­ond) …

Some use­ful Javascript relat­ed linksRead More »

Having fun with HTML5 — Canvas, part 1

One of the cool new fea­tures intro­duced by HTML5 is the new <can­vas> tag, which defines an area for you to draw graph­ics on using javascript. Basics To cre­ate a can­vas ele­ment is as easy as insert­ing a <can­vas> tag like this: Typ­i­cal­ly you will give it an ID as you will need to look …

Hav­ing fun with HTML5 — Can­vas, part 1Read More »

Having fun with HTML5 — Local Storage and Session Storage

HTML5 includes two new ways to store data on the client – local stor­age and ses­sion stor­age. Local stor­age has no time lim­it on how long the data should be kept around, ses­sion stor­age on the oth­er hand (as the name sug­gests) stores data for only one ses­sion. Tra­di­tion­al­ly you can store data on the …

Hav­ing fun with HTML5 — Local Stor­age and Ses­sion Stor­ageRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.