Skip to main content

Posts

Showing posts with the label JSON

DevOps : Search and replace files with JSON dataset and template Engine

Today's code build & continuous deployment models are highly diverse thus leading to handwritten and complicated perl/awk/sed scripts. DevOps should come out of age old hand-crafted find and replace scripts with much modern template engines.               Of course template engines are available in wide variety. All enterprise configuration management (chef, puppet, ansible ) software are equipped with their own flavour of template engines and playbooks.  This article however concentrate on "Mustache" template  which is logicless template system and work on any text based data (Web pages, scripts, dataset, config files etc..)               The example below focusses on replacing dynamic text using a JSON dataset. Let's define terminologies Source :   Template Parent Directory with all files/directories +  dynamic variables in it Dataset :    JSON based self defining dataset to replace the above source(s) Params :    Extra parameters that are supplied (eg

CRUD form using Datatables with dynamic Add & Delete rows

Hope you guys have suffered same issues as me with Web Development to create forms with Create/Read/Update/Delete functionality. I really use "Datatables" ( www.datatables.net ) for displaying data in tabular format.  Datatables has got many advantages and is easily compatible with bootstrap stylings. IE8+ support, major browser support and uses jQuery as its core Can natively map JSON data Searching and Filtering functionality with pagination Support MultiLanguage support, ClientSide Sorting, AJAX based inputs Can filter required Columns at front-end Datatables is free but it's editor (editable tables) are paid. Hence I thought of putting together a simple table to use for editing and publishing data for POST purposes. In Summary, what we are doing here is Creating HTML stub with table headers within a form . Also add "Add Row" and "Delete Row" buttons with onclick actions attached to it and a "Submit" button In your javas