ebook img

CoffeeScript Application Development Cookbook PDF

368 Pages·2015·3.983 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview CoffeeScript Application Development Cookbook

CoffeeScript Application Development Cookbook Over 90 hands-on recipes to help you develop engaging applications using CoffeeScript Mike Hatfield BIRMINGHAM - MUMBAI CoffeeScript Application Development Cookbook Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: March 2015 Production reference: 1260315 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78328-969-1 www.packtpub.com Cover image by Jason Hatfield ([email protected]) Credits Author Project Coordinator Mike Hatfield Harshal Ved Reviewers Proofreaders Becker Simran Bhogal Paul Jensen Maria Gould Alexey Smirnov Paul Hindle Commissioning Editor Indexer Martin Bell Monica Ajmera Mehta Acquisition Editor Graphics Rebecca Youé Abhinash Sahu Content Development Editor Production Coordinator Ajinkya Paranjape Conidon Miranda Technical Editors Cover Work Mrunal M. Chavan Conidon Miranda Dennis John Tanmayee Patil Shiny Poojary Copy Editors Karuna Narayanan Adithi Shetty About the Author Mike Hatfield has over 25 years of experience in developing custom business solutions for a variety of clients and industries. With a focus on the ever-expanding Web, Mike has crafted hundreds of web-based applications while spending the last couple of years developing business solutions for the mobile web. He is the chief technology officer at Nicom IT Solutions Inc., a large independent IT consulting firm based in Halifax, Canada. As the CTO, Mike remains on the lookout for emerging trends in the development industry to identify new opportunities for his clients. With his wife, Tracy, and their three children, Chris, Jason, and Jennifer, he lives a quiet suburban life while continually learning new technologies and satisfying his love of horror movies. As a first-time author, my wife's support has played an integral part in helping me see this book through to the end. Thank you Tracy, I could not have done it without you. About the Reviewers Becker is a software engineer with expertise in the Ruby ecosystem. Passionate about building products people love from the ground up, he can usually be found working with a small team at a local start-up doing what he does best: writing code and making espresso! Always open to learning new tools and technologies, Becker has become particularly enamored with CoffeeScript based on its intuitive and clean structure and ease of use. In his mind, CoffeeScript and Ruby are a perfect pairing for happy development! Becker lives with his family in Seattle, Washington. He has also a worked on CoffeeScript Application Development, Packt Publishing (https://www.packtpub.com/web-development/coffeescript-application- development). Paul Jensen is the founder of Anephenix. He is also the lead developer of the SocketStream web framework and the creator of Dashku, a real-time dashboard application. Alexey Smirnov works as a software engineer in a cloud computing start-up company, iRONYUN. He is broadly interested in web frameworks as well as iOS application development. In his spare time, he builds websites for nonprofit organizations. Alexey got his master's degree in computer science from Stony Brook University, USA. www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print, and bookmark content f On demand and accessible via a web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface v Chapter 1: Getting Ready 1 Introduction 1 Configuring your environment and tools 3 Configuring Sublime Text 4 Configuring Visual Studio 7 A quick dive into CoffeeScript 10 Debugging CoffeeScript using source maps 16 Debugging CoffeeScript using Node Inspector 18 Chapter 2: Starting with the Basics 21 Introduction 21 Working with strings 21 Working with numbers 32 Working with dates and times 39 Working with arrays 46 Working with classes 55 Dealing with the this keyword 61 Chapter 3: Creating Client Applications 65 Introduction 65 Working with jQuery 66 Working with Backbone 84 Working with AngularJS 96 Communicating in real time with Socket.io 115 Chapter 4: Using Kendo UI for Desktop and Mobile Applications 121 Introduction 121 Using the Kendo UI Core widgets 122 Using the Kendo UI Core mobile widgets 134 i Table of Contents Chapter 5: Going Native with Cordova 145 Introduction 145 Creating a basic Cordova application 146 Using the camera 147 Using geolocation 151 Using contacts 155 Getting device information 159 Chapter 6: Working with Databases 161 Introduction 161 Working with SQLite 161 Working with Redis 171 Working with MongoDB 181 Working with CouchDB 191 Chapter 7: Building Application Services 201 Introduction 201 Working with base64 encoding 201 Working with domain name services 204 Parsing a URL into its various components 208 Creating RESTful web services 210 Chapter 8: Using External Services 225 Introduction 225 Working with web services 225 Sending e-mail 231 Sending SMS and MMS messages 234 Working with Amazon's S3 storage 237 Transferring files via FTP 248 Chapter 9: Testing Our Applications 257 Introduction 257 Unit testing with QUnit 258 End-to-end testing with Mocha and Zombie.js 268 Stubbing and mocking with Sinon 274 Chapter 10: Hosting Our Web Applications 283 Introduction 283 Compiling our source with Grunt 283 Preparing deployments for staging and production 289 Deploying our application to Heroku 295 Deploying our application to Microsoft Azure 300 ii Table of Contents Chapter 11: Scripting for DevOps 309 Introduction 309 Executing shell commands with exec 310 Executing shell commands with spawn 312 Copying, moving, and deleting files and directories 315 Archiving files and directories 318 Parsing CSV files 320 Parsing fixed-width files 325 Padding and aligning output 330 Formatting dates with moment.js 333 Formatting numbers with accounting.js 335 Index 341 iii

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.