title | prism_languages | tags | layout | ||
---|---|---|---|---|---|
Firebase |
|
|
2017/sheet |
There is no way to store an empty object/array/null value.
There are also no actual arrays. Array values get stored as objects with integer keys.
(If all keys are integers, it will be returned as an array.)
Basically, it's one giant tree of hashes with string keys.
Simply write a value to any location, and the intermediary locations will automatically come into existance.
── Classes ──
DataSnapshot : Container for a subtree of data at a particular location.
man COMMAND # Look up help for the given command
pwd # Print working directory cd MYDIR # Change directory to MYDIR cd ~/ # Change directory to user root (/Users/USERNAME) cd .. # Change directory up a level mkdir NEWDIR # Create a new directory in the current folder called NEWDIR
cp FROM_FILE TO_FOLDER # Copy FROM_FILE into TO_FOLDER cp -r FROM_DIR TO_FOLDER # Copy FROM_DIR into TO_FOLDER
Ionic 3 cheat sheet by Benjamin
Les commandes principales:
- npm install -g cordova ionic #Installer Ionic
- $ ionic info #Récupérer toutes les info
- $ ionic start blank #Créer un projet vierge
- $ ionic start "myApp" #Multiple choix de création de projet
- $ ionic generate #Creation divers
- $ ionic generate component
Use service for any Class
that is to be mapped into the dependency injector
.
Do not use a service for a method (use a Class
instead).
Services are implemented as a Class
and should be PascalCase
. Angular will instantiate once only and inject the same instance
in all cases. The dependency is therefore camelCase
since it is an instance and should not be new
'd. For example:
angular.module(...).service('myService', MyService);
Use a controller to augment shared scope
.
- To decorate it with
value
that HTMLpartials
may bind to. - To provide
behaviour
that HTMLpartials
may invoke.
Do not use a controller:
- To store application state (describe in the
route
instead). - To store persistent data (controllers and scope are dropped on every route change, use
service
instead). - To implement behaviour and business logic (defer to a
service
).
Use a directive to augment a DOM
node:
- To transform its contents in a regular manner.
- To add a behaviour that is general and reusable.
Do not use a directive:
- To augment or manipulate shared
scope
(use acontroller
instead). - To allow a partial to include another partial specific to your application (this is not composable, use nested states instead).
It is important not to hide composition. It should be done centrally, at the root of the application.
In angular there are 2 different resources we must compose in order to build an application
-
Using a composition root we map
directives
,controllers
, andservices
into theinjector
. -
Using routing we compose views from HTML
partials
andcontrollers
for each different application state.
Operation | Code |
---|---|
New List |
List<Integer> x = new ArrayList<Integer>(); |
Copy List |
List<Integer> x = new ArrayList<Integer>(y); |
Add an element to the List |
x.add(element) |
Get an elemenet from the List |
x.get(index) |
Clear the list | x.clear() |
New HashMap |
HashMap<Integer, String> x = new HashMap<Integer, String>(); |
Add element to the map | x.put(key, value) |
Get an element from the map | x.get(key) |
This file will cover important coding practices that are important to stress when coding this program. Listed below are some of the more important details that should be stressed. Each programmer has his/her own way to deliver code. The importance of having similar coding conventions throughout this program are listed below.
- 80% of the time spent on a piece of software goes to maintenance.
- Hardly any software is maintained for its whole life by the original author.
- Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
- If you ship your source code as a product, you need to make sure it is as well packaged and clean as any other product you create.