Skip to content

Instantly share code, notes, and snippets.

@jgraber
Last active December 16, 2015 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgraber/5429729 to your computer and use it in GitHub Desktop.
Save jgraber/5429729 to your computer and use it in GitHub Desktop.

Programming in HTML5 with JavaScript and CSS3

Implement and manipulate document structures and objects (24%)

Create the document structure Structure the UI by using semantic markup, including for search engines and screen readers (Section, Article, Nav, Header, Footer, and Aside); create a layout container in HTML

Write code that interacts with UI controls

Programmatically add and modify HTML elements; implement media controls; implement HTML5 canvas and SVG graphics

Apply styling to HTML elements programmatically

Change the location of an element; apply a transform; show and hide elements

Implement HTML5 APIs

Implement storage APIs, AppCache API, and Geolocation API

Establish the scope of objects and variables

Define the lifetime of variables; keep objects out of the global namespace; use the “this” keyword to reference an object that fired an event; scope variables locally and globally

Create and implement objects and methods

Implement native objects; create custom objects and custom properties for native objects using prototypes and functions; inherit from an object; implement native methods and create custom methods

Implement program flow (25%)

Implement program flow

Iterate across collections and array items; manage program decisions by using switch statements, if/then, and operators; evaluate expressions

Raise and handle an event

Handle common events exposed by DOM (OnBlur, OnFocus, OnClick); declare and handle bubbled events; handle an event by using an anonymous function

Implement exception handling

Set and respond to error codes; throw an exception; request for null checks; implement try-catch-finally blocks

Implement a callback

Receive messages from the HTML5 WebSocket API; use jQuery to make an AJAX call; wire up an event; implement a callback by using anonymous functions; handle the “this” pointer

Create a web worker process

Start and stop a web worker; pass data to a web worker; configure timeouts and intervals on the web worker; register an event listener for the web worker; limitations of a web worker

Access and secure data (26%)

Validate user input by using HTML5 elements

Choose the appropriate controls based on requirements; implement HTML input types and content attributes (for example, required) to collect user input

Validate user input by using JavaScript

Evaluate a regular expression to validate the input format; validate that you are getting the right kind of data type by using built-in functions; prevent code injection

Consume data

Consume JSON and XML data; retrieve data by using web services; load data or get data from other sources by using XMLHTTPRequest

Serialize, deserialize, and transmit data

Binary data; text data (JSON, XML); implement the jQuery serialize method; Form.Submit; parse data; send data by using XMLHTTPRequest; sanitize input by using URI/form encoding

Use CSS3 in applications (25%)

Style HTML text properties

Apply styles to text appearance (color, bold, italics); apply styles to text font (WOFF and @font-face, size); apply styles to text alignment, spacing, and indentation; apply styles to text hyphenation; apply styles for a text drop shadow

Style HTML box properties

Apply styles to alter appearance attributes (size, border and rounding border corners, outline, padding, margin); apply styles to alter graphic effects (transparency, opacity, background image, gradients, shadow, clipping); apply styles to establish and change an element’s position (static, relative, absolute, fixed)

Create a flexible content layout

Implement a layout using a flexible box model; implement a layout using multi-column; implement a layout using position floating and exclusions; implement a layout using grid alignment; implement a layout using regions, grouping, and nesting

Create an animated and adaptive UI

Animate objects by applying CSS transitions; apply 3-D and 2-D transformations; adjust UI based on media queries (device adaptations for output formats, displays, and representations); hide or disable controls

Find elements by using CSS selectors and jQuery

Choose the correct selector to reference an element; define element, style, and attribute selectors; find elements by using pseudo-elements and pseudo-classes (for example, :before, :first-line, :first-letter, :target, :lang, :checked, :first-child)

Structure a CSS file by using CSS selectors

Reference elements correctly; implement inheritance; override inheritance by using !important; style an element based on pseudo-elements and pseudo-classes (for example, :before, :first-line, :first-letter, :target, :lang, :checked, :first-child)

Rails Demo App

Usage

$ filentory-cli --log-level fatal "demo" .
 {
 "^o":"Datastore",
 "name":"demo",
 "files":[
   [
     {
       "^o":"FileEntry",
       "path":".",
       "name":"50quickideas.pdf",
       "last_modified":"2014-01-01T18:06:12+01:00",
       "size":49447,
       "checksum":"348a5b72877dcb5e0354f8eef62e5ff4e546043881dd051b9f8c2dea6ab23bb7"
     }
   ]
 }

Contributing

start

rails new dnugbooks

git init

git add .

git commit -m "start with plain new rails app"

Cleanup

cd books

/remove # from therubyracer in Gemfile

git commit -a -m "cleanup"

Add Twitter Bootstrap

/add gem 'twitter-bootstrap-rails' to Gemfile

/add gem "less-rails" to Gemfile

bundle

rails g bootstrap:install

rails g bootstrap:layout application fluid

git add . && git commit -a -m "add Twitter Bootstrap"

Add Book and Author

rails g scaffold book title:string isbn:string description:string

rails g scaffold author lastname:string firstname:string twitter:string

rake db:create && rake db:migrate

rails g bootstrap:themed books

rails g bootstrap:themed authors

/add root to: 'books#index' to routes.rb

/edit set paths in application.rb

git add . && git commit -a -m "add book and author"

Add MiniProfiler & dev tools

/add gem 'rack-mini-profiler' to Gemfile

/add gem 'quiet_assets' to Gemfile

/add gem 'better_errors' to Gemfile

bundle

git add . && git commit -a -m "add MiniProfiler & dev tools"

Add n:m Relations

rails g model authorship author:references book:references

rake db:migrate

/add authorship to book and author

/add _authors_fields to book

/add link-helpers to application_helper

/add js helpers to application.js

/add authors_attributes to book_params in books_controller.rb

git add . && git commit -a -m "add n:m relationship"

Add Paging

/add gem 'kaminari' to Gemfile

bundle

rails g kaminari:views default

/add paging to author & book

/add paging to author & book controller

/add pager to index views

git add . && git commit -a -m "add Paging"

Deploy to Heroku

/add pg to Gemfile and use sqlite only in dev

/add rails version to Gemfile

/edit environments/production.rb and set **config.assets.compile = true**

bundle

git add . && git commit -a -m "prepare deployment to Heroku"

/usr/local/heroku/bin/heroku create

heroku addons:add heroku-postgresql

git push heroku master

heroku run rake --trace db:migrate

heroku logs

Filentory-cli Build Status Code Climate Gem Version

A tool to create an inventory of a storage medium.

Installation

Add this line to your application's Gemfile:

gem 'filentory-cli'

And then execute:

$ bundle

Or install it yourself as:

$ gem install filentory-cli

Usage

$ filentory-cli --log-level fatal "demo" .
 {
 "^o":"Datastore",
 "name":"demo",
 "files":[
   [
     {
       "^o":"FileEntry",
       "path":".",
       "name":"50quickideas.pdf",
       "last_modified":"2014-01-01T18:06:12+01:00",
       "size":49447,
       "checksum":"348a5b72877dcb5e0354f8eef62e5ff4e546043881dd051b9f8c2dea6ab23bb7"
     }
   ]
 }

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment