Use Dropbox As a Web Server. Kinda.

  • Dropbox can serve files over HTTP
  • To view the file over http users don’t need to have any Dropbox account
  • You can share only static web resources pages, e.g. HTML, CSS, JS and images, of course
  • For images Dropbox sends header cache-control: max-age=0. That means that images are not cached at client side.
  • Dropbox also generates content type header based on file extension. e.g. for png files it send the header Content-Type:image/png
  • Everything in Public Folder is automatically shared and generates a URL
  • Files and folders from locations other than Public Folders can also be shared

Source: How to use dropbox as mini webserver

AngularJS Directive’s Scope

scope:falseDirective uses its parent scope. Changes are reflected in both parent & child

scope:true - Directive gets a new scope. Changes are reflected only in child but not in parent

scope:{} - Directive gets a new isolated scope. No inheritance & changes are not reflected at all.

In the third option, we need to declare parameters in order to pass values from parent:

scope: {
    name: ‘@’, // expression
    age: ‘=’,     // model name
    emailAddress: ‘&’   // method
}

<user-card class=”myClass” name=”{{ myName }}” age=”myAge” email-address=”getMyMail()” />

@ - Text binding / one-way binding
= - Direct model binding / two-way binding
& - Behavior binding / Method binding

Source: Mastering the Scope of the Directives in AngularJS

Async vs. Defer Script Attributes

Legend:

image

Script tag - no attributes:

<script src=”someScript.js”></script>

image

  1. HTML rendering
  2. Reach to script tag - rendering halts
  3. Script downloading
  4. Script downloaded - script execution
  5. HTML rendering - continues till completion

Script tag - Async attributes:

<script src=”someScript.js” async></script>

image

  1. HTML rendering
  2. Reach to script tag - rendering continues + script downloading
  3. Script downloaded - rendering halts + script execution
  4. HTML rendering - continues till completion

Script tag - Defer attributes:

<script src=”someScript.js” defer></script>

image

  1. HTML rendering
  2. Reach to script tag - rendering continues + script downloading
  3. HTML rendering - continues till completion + script downloaded
  4. Script execution

Source: async vs defer attributes