Showing posts with label html5. Show all posts
Showing posts with label html5. Show all posts

Friday, 5 September 2014

Ionic & Yeoman

Ionic HTML5 Mobile App Framework 
# create new folder for app and open it
mkdir my-ionic-project && cd $_
# clear npm cache. more info @ NPM config 
rm -rf ~/.npm 
npm clear cache
# install generator-ionic globally
npm install -g generator-ionic
# installs:
  • Lo-Dash.js (Utility Library. Superset of Underscore.js)
  • Chalk (Package for Terminal string styling)
  • MOUT { Modular JS Utility Collection. Use whole package or individual Modules (Helper Methods) }, includes Dependencies:
    • Commander.js (Node.js Full Command-Line Interface Utility)
    • Handlebars (Semantic templates)
    • Istanbul (JS code coverage)
    • Jasmine-Node (Node.js integration of Jasmine Spec Framework)
    • JSHint (JS error detection)
    • MDOC (Markdown based documentation generator)
    • Nodefy { convert AMD JS modules (RequireJS define(..) into Node.js format (module.exports...) }
    • Regenerate (JS RegEx generator
    • RequireJS { Node.js Adapter for RequireJS (loading AMD Modules) incl. Optimiser (Minifies Scripts, CSS Inlined w/out Comments) }
    • RimRaf { Node.js deep Deletion Module (rm -rf) }
    • Rocambole { Recursive walk and manipulate EcmaScript Abstract Syntax Tree (AST) to Compile code (i.e. Rocambole Visualiser) }
  • Yeoman-Generator { Rails-inspired Generator System to Scaffold apps }, adds Additional Dependencies:
    • Dargs { Spawn CLTs by Converting Options Object into Command-Line (CL) Args }
    • Diff { Text Differences for JS (Sample) } 
    • Debug { Node.js Debugging Utility }
    • Mime { Mime-type Mapping API includes Node.js and Apache Project extensions }
    • Text-table { Text Tables borderless and aligned to print to STDOUT }
    • Async (Node.js Utility Module with Functions for Asynchronous JS)
    • Mkdirp (Node.js Recursively create Nested Directories)
    • Isbinaryfile (Node.js check if file is binary)
    • Shelljs (Node.js portable Unix Shell commands)
    • Underscore.string (Underscore.js String manipulation for JS) 
    • Iconv-lite (Convert character encoding/decoding in JS)
    • Glob (Pattern Matching search walking either Sync/Async)
    • Findup-sync (Pattern Matching first File found in current or nearest Ancestor Directory)
    • File-utils { User CLT Sync File and Directory Utils (do not use on Node.js server as is equivalent to Grunt.file) } 
    • Cheerio (Lean Server implementation of core jQuery)
    • Request {Node.js HTTP and HTTPS Request Client (Forwarding, File Streaming, Piping, Proxies, Unix Sockets, Form Data URL Encoding, HTTP Auth, OAuth Signing, Custom HTTP Headers) }
    • Inquirer { Node.js Collection of Common Interactive CLIs (lightweight form of Commander.js }
  • Cordova { Platform to build Native Mobile apps using HTML, CSS, JS }, adds Additional Dependencies:
    • Q { Tool for creating Promises in JS. then method resolves handling eventual return value (fulfillment) or thrown exception (rejection) asynchronously and mitigates the Pyramid of Doom } UncommonJS Promises Manager
    • Semver (NPMs semantic parser of package versions in package.json file)
    • Underscore (Helper Library for JS is Underscore.js)
    • Plist-with-patches (Node.js parsing of Property List files (.Plist) or string into native JS object with Pull requests applied)
    • Optimist (lightweight Option Parsing with Argv Hash)
    • Npmconf (NPM configuration. Alternative RC)
    • Xcode (Node.js parser of xcodeproj/project.pbxproj files)
    • Tar (compression)
    • Elementtree { Module for XML serialization (creation) and parsing }
    • Plugman (Install/Uninstall Cordova plugins)
yo ionic
# installs:


# ionic starter blank creates:
  • Gruntfile.js
  • .gitignore
  • hooks/after_prepare/icons_and_splashscreens.js (Scripts executed before and after directory-related commands) Example Hooks
  • test/spec/controllers.js
# bower_components folder (similar to the /vendor folder in Rails) updated with: 
  • Collide (JS animation engine built by Ionic Framework team allowing developers to hook into every frame)
  • Angular-ui-router (AngularJS flexible routing with nested views to organise parts of interface into a state machine)
  • Angular-mocks (testing)
  • Angular-sanitize (Parse HTML using tokens to avoid unsafe input with ngSanitize)
  • Angular-animate (Animation hooks for common Directives using ngAnimate)
  • Angular-scenario
    • TODO: 
    • TODO - Test Driven Development (TDD)
      • Karma { Cross-browser HTML Test Server & Runner } uses Plugins / Adapters
        • Jasmine { AngularJS Testing Framework
        • Protractor { AngularJS Testing Framework End-to-end using Jasmine as Test Interface and Selenium Server to control browsers}
        • Mocha { JS Testing Framework. Integrates with GitHub }
          • Chai { Assertion Library }
        • PhantomJS { Testing code on Headless Instance }
        • Istanbul { Automatic Coverage Report Generation }
        • RequireJS { Modular Script and Source File Loader. Optimises and Minifies JS for Deployment }
        • QUnit { EmberJS Testing Framework }
      • Continuous Integration & Deployment Pipeline
        • Adobe PhoneGap Build { Free for Open Source. JS. GitHub Integration. }
        • Codeship  { Free for Open Source. Multiple Languages / Endpoints / Tools / Databases. GitHub Integration. }
        • Jenkins CI { AngularJS Automated Tests. GitHub Integration }
        • Travis CI { Automated Tests. GitHub Integration. Integrated using a YAML file. Results in Pull Requests }
        • Semaphore CI { GitHub Integration. Platform includes NodeJS, PhantomJS, and Headless Firefox }
        • CircleCI $19/mth+ { Multiple Languages. GitHub Integration. Fast }
      • Beta Testing
      • Sass
      • Encryption
        • Database Encryption
      • UI Libraries & Tools
      • Scaffolding Tool (modular code shell generator similar to the role of Rails)
        • Yo (Yeoman)
          • Package.json { informs Node.js of specific packages and version the specific project needs installed (instead of all installed globally) }
          • Bower.json { informs Bower of JS and CSS components to install in /app/bower_components }
          • Gruntfile.js { set of task instructions on specific project for Grunt } 
          • Angular Generator of Boilerplate  
            • Generates Modules { controllers, directives, filters, routes (controller + view), services (providers, factories, values, constants), decorators (with config and delegate), views }
            • Modules (resources)
            • Bootstrap
      • Build & Utility Tools (modular Configuration & Tasks)
        • Grunt { i.e. optimisation tasks including JS and CSS concatenation and/or minification (__.main.css, __.plugins.js, __.scripts.js), running local server, JS error checking and unit tests, Grunt server (uses Node.js) for live reload of changes with re-compiled Sass and CoffeeScript. Similar to Ant for Java }
        • Gulp
      • Packaging
      • Package Manager (Dependency Managers. use npm install (or update) [-g] and bower install to install tools in Package.json into /app/node_packages and Bower.json into /app/bower_components)
        • npm (Node Package Manager) { Installation Utility }
        • Bower { Web component dependency installer (i.e. bower install --save __ to add to list of dependencies in Bower.json). Similar to Maven and Ivy in Java }
        • Wiredep { Bower dependency Injection from Grunt into HTML. Manage JS and CSS includes. }
      • APIs
        • Google Maps
        • PubNub (Websockets)
  • Alias Ionic Unix Commands
    • Setup an alias function in your .bash_profile
gii() { gulp sass ; ionic build ios ; ionic emulate ios ; }



Sublime Text 2
  • Custom Tab Spaces
    • Open a document in Sublime Text 2 with the File Extension that you want to apply custom tab spacing to (i.e. two tab spaces preceding the code instead of the default of four spaces when you press the 'tab' key on your keyboard)
    • Go to the Menu and select: Sublime Text 2 > Preferences > Settings - More > Syntax Specific - User
    • Paste the following in the file that has opened automatically and then save it 
{
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "detect_indentation": false
}

Contributions

Links

    Sunday, 23 March 2014

    WDI Progress Update - Final Project (Littlehumans), Brainstorming, Mock Interviews, Codium

    Challenges
    • Littlehumans (Medical App for Midwives and Parents of New Born Children)
      • Problems faced
        • Combined OAuth Login (Facebook, Twitter, Google) with Devise spend all day Saturday trying to get it to work in Production environment (managed to get Google, Facebook, and Twitter to work)
        • See 'About Us' page at the Littlehumans website for other challenges
    • Dancing at Karaoke!
    Progress @ General Assembly (GA)
    • Littlehumans Final Project
      • Heroku Link: Littlehumans App    
      • Tech Stack: View the 'About Us' page at the link above
      • Purpose: Midwife app for Midwives and Parents to track and share New Born Baby information and key Moments (input from my partner who is a professional midwife)
    • Sunday Javascript - with Daniel Tsui
      • Challenging Tests
      • Immediately Invoked Function (IIFE)
      • .Then
      • Hoisting
      • First Class Citizen
    • Javascript Ecosystem - Presentation by Je Turnbull
      • Multi-paradigm (MPM) and styles 
      • Automation and Task Runners
      • Package Management
      • JS Essential Knowledge and Tools
      • Front-end Job Questions
      • JS Testing
      • Scope and Closures
      • Recommended Books
    • Codium Group Project
      • Twitter Gem - Solved ability to scrape blog posts
    Curiosity

    Friday, 14 March 2014

    WDI Progress Update - Advanced Rails Caching, SASS, Websockets, Javascript Evolution & Frameworks, Group Project Implementation

    Challenges
    • Backbone.js and Burning Airlines - 6 hrs preparing Burning Airlines MVC for Flights on 13th Mar:
      • Problems fixed thanks to help from team in the morning:
        • Missing from app.js
          • Async call to fetch flight collection model and Router
        • Correction in FlightsController
          • 'respond_with @flights' instead of 'respond_with :json => @flights' to prevent embedded JSON
        • Removing JBuilder.json file that was merged after git pull from master, and caused only id and url to appear at URL /flights/flights.json (code previously pushed compiled successfully and listed flights)
        • Binding(this) to enable Search button functionality for on-click 
        • Debugging in Chrome Inspect Element using CMD+' to skip to next line of code for testing, and hovering over variables to show current value 
    • Pomodoro Time Management

    Progress @ General Assembly (GA)
    • Group Airline Project (Implementation)
      • Team: Marcus Hoile, Sam Peters, Alberto Forni, Luke Schoen
    • Javascript Evolution
      • JS Framework Types: 
        • Full-stack - Derby (real-time apps), Sails (like Rails), Meteor (new with potential security issues)
        • Front-end - Backbone.js, Marionette, Knockout, React, CanJS
        • Front-end + Datamining - Angular, Ember
        • Back-end frameworks, Websockets, 
        • Templating - Handlebars
        • Other: Batman, Express Polymer, Socketstream, Clojure
      • Websockets (Socket.io to manage HTML5 websockets, real-time control to sync broadcast changes without overhead HTTP)
      • Proxy Servers - NGrok
      • Separate Loading Templates - .jst.ejs and Global Namespaces
    • Caching in Rails
      • Client-side & Server-side (Page, Action, Fragment)
      • ActionPageCaching GEM
      • ActionPackCaching GEM
      • Rake Task Sweepers
      • SQL Query Caching
      • Memcache, Nullcache
    • SASS (Nested, Interpolating Content, Variables, Mixins, Cross-File Mixins, Inheritance, Pseudo Selectors, Asset Pipeline, Image-Path and Asset-Path for Production)
    • Presentation TankStream Labs
      • Key Takeaways:
        • Lifestyle & Work
          • Startup Org Fit Evaluation Essentials
          • Recording Skills
          • Cocurricular and Coding
        • Language Agility
          • Erlang, Haskell
        • Terminology & Tools
          • Strong Parameters
          • Async Processing and Delays (SidekiQ + Reddis)
          • Scheduling Processes (Cron + Whenever)
          • XML Parsing (Nokogiri)
          • PDF (Prawn, PDFQueue)
          • Debugging (Pry)
          • Uploading Files (Paperclip, Carrierwave)
          • Sublime GEMS (GEM Browser, Git Extensions)
          • JSON (JBuilder, JSON Serializers, Draper)
          • Image Resizing (LibXML image munging, Image Magic)
          • Communicate Validation in Natural Language (Chronic, Chronorails GEM)
    Purchases
    Events
    • Fisburners - Chat with Mark (Movie guru), met David (recommended Founders Institute), Dimitri, Jenny, and Matthews B'day

    Saturday, 1 March 2014

    WDI Progress Update - Presentations (Group Project)

    Challenges:
    1. Reading "Agile Development with Rails 4" this weekend
      • Core:
        • Unless, Until, If, While 
        • Pass Block as Named Parameter
        • Exceptions, Rescue
        • Instance Variables, Convenience Methods,
        • Public, Private, Protected Methods
        • Modules and Helper Methods
        • YAML, Marshalling Objects, Sessions
        • Ruby Idioms
        • File Relative Expand Path Method
        • Aliasing
      • Shopping Cart App
        • Preliminary Analysis
          • Incremental Development
          • Use Cases, Different Actors
          • Iteration Feedback
          • Page Flow for each Actor
          • Data Diagrams for App
        • Create App
          • Create Database for App Product Maintenance
          • Nested CSS matching each Controller
          • Git Ignore
        • Validation and Unit Testing
          • Validation before write to DB
          • Unit Test Models Test Infrastructure
          • MiniTest Unit Framework subclass TestCase
          • Rake Test Models
          • Test Fixtures and YAML Format
          • Associate based Stories for Fixture Names
          • Using Test DB vs Development DB
          • Up to Page 105 / 439
      • Ruby Quick Ref (Range, RegEx, FileIO, Var, Cmd Line, IRB, Operator uses, Control method uses, Invoking Methods, Defining Class/Methods/Modules, Access Restrictions, Accessors, Aliasing, Procs, Closures, Exception Catch/Throw/Raise/Rescue, MiniTest)
    Progress @ General Assembly (GA)
    • Group Project Presentations
      • Team #1 - Autism Connect Autismconnect.herokuapp.com (Sam Peters, Emily McCartney, Lauren Krueger, Luke Mesiti) - Key Takeaways
        • Gems: Geocoder, Googlemaps, Strap (payments similar to PayPal), 4em??, Pundit and Cancan (forums)
        • Authentication: OmniAuth (Google), Devise
        • Search: Polymorphic (finds anything with tags many to many)
        • Effects: Paralax (slide toggle left right)
        • Method: Staged implementation with Gems
      • Team #2 - Shared Expense Tracker Wdiexpense.herokuapp.com (Pranava Swaroop, Federico Tagliabue, Marcus Hoile) - Key Takeaways
        • Gems: AASM Management (management of workflow change status of groups/resources), Bootstrap Gem Fonts?
        • Future: Integrate with Whatsapp.com, share on Facebook timeline, Available offline (caching on mobile), Monetise with buying patterns, white label lnegotations, sell to property management firms
        • Method: Daily standups and end of day checkins, Git branching, dealing with Git conflicts merging, teamwork

    • Presentation - Gregory McIntyre, Yourtutor.com.au (Life as a Developer) - Key takeaways:
      • Agile Development - Pair Programming, Productivity and Independence, Conversations and Minutes, Values Visibility, Iron Triangle {Scope, Schedule, and Resources + Quality Centre} > No compromise for Quality, Risk Matrix mitigates to ALARP with Strategies, Burn Down Chart (Jellybean measurement), Kanban (pool model visualisation to minimise waste), Lumpy graph (steady flow rate to customers, resource match issues if lumpy progress), Feedback iterative loop (Assess, Agree, Execute) impacted by Scope changes, Poker Estimation (fold over cards and argue to check assumptions and avoid diminishing returns), Card Walls (Agile workspaces, Post-its easy to track, hard avoid responsibility, issue in distributed teams)
      • Agile Ideals - Deliver something of value everyday
      • TDD - Refactor, Fail, Pass, Repeat
      • BDD - Cust. Feedback Driven, TDD is embedded circles within BDD
      • Continuous Integration and Deployment
      • Latest News: Ruby Weekly, Javascript Daily, Postgres Weekly (signed-up)
    Curiosity:

    Sunday, 9 February 2014

    WDI Progress Update - Trendmyhunch Extras, Google Analytics Client Authentication using Service Account and OAuth

    Challenges:
    • Google Analytics Client, Google's API Developers Console (connected!)
    • Google Maps Coordinate API (yet to attempt)
    • Extras add to My Website: Trendmyhunch
      • Collapsing Menu
      • Anchors
      • Select / Unselect All
      • Feedback form (failed on heroku push, stuck on whether i need https://devcenter.heroku.com/articles/sendgrid#ruby-rails)
        • Troubles #1 tried Sample Contact Form on Github, Mailgun and associated documentation, etc (unable to use free SendGrid due to past personal income issues), might have revert back to PHP! Yikes!!
      • Authentication with Google Analytics Client using Service Account and OAuth! (noted the importance of using the correct 8 digit number after the letter 'p' in the URL when in the Analytics Account Settings of the correct App!! didn't realise this initially and was getting error 403)
      • Troubles #2 - Can't upload to Github to mirror pushes to Heroku! Bugger...
    • Important Note: Gem Garb could have saved me a lot of time connecting to Google Analytics! 
    • Played around with dashing, puma server, rufus scheduler, and redis, and rendered my heroku site useless (site still works on local server though...)  ----> discovered that the reason it wasn't working on Heroku was because there  were remnance of Dash (which I wasn't using). the error was only exposed when i ran "rails console production". to solve the issue i just opened the /app/jobs/sample.rb file and commented the whole file.

    ~/Documents/w5d1_project/ideas_app/trendmyhunch ✗ master ∴ rails consoleLoading development environment (Rails 4.0.2)2.1.0 :001 > exit~/Documents/w5d1_project/ideas_app/trendmyhunch ✗ master ∴ rails console production/Users/Luke/Documents/w5d1_project/ideas_app/trendmyhunch/app/jobs/sample.rb:3:in `<top (required)>': uninitialized constant Dashing (NameError)


    Progress @ General Assembly (GA):
    • Analytics (Conditionally included Analytics)

    Curiosity:
    • Segment.io