mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-25 16:23:37 +03:00
Merge pull request #809 from levibostian/little-fixes-after-merging
Little fixes after merging
This commit is contained in:
commit
115f35287f
@ -8,7 +8,11 @@ filename: learnamd.js
|
||||
|
||||
## Getting Started with AMD
|
||||
|
||||
The **Asynchronous Module Definition** API specifies a mechanism for defining JavaScript modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment where synchronous loading of modules incurs performance, usability, debugging, and cross-domain access problems.
|
||||
The **Asynchronous Module Definition** API specifies a mechanism for defining
|
||||
JavaScript modules such that the module and its dependencies can be asynchronously
|
||||
loaded. This is particularly well suited for the browser environment where
|
||||
synchronous loading of modules incurs performance, usability, debugging, and
|
||||
cross-domain access problems.
|
||||
|
||||
### Basic concept
|
||||
```javascript
|
||||
@ -55,7 +59,7 @@ require(['loudmouth'], function(loudmouth){
|
||||
loudmouth();
|
||||
});
|
||||
|
||||
// To make this tutorial running code, let's implement a very basic
|
||||
// To make this tutorial run code, let's implement a very basic
|
||||
// (non-asynchronous) version of AMD right here on the spot:
|
||||
function define(name, deps, factory){
|
||||
// notice how modules without dependencies are handled
|
||||
|
@ -202,7 +202,7 @@ uniq -d file.txt
|
||||
cut -d ',' -f 1 file.txt
|
||||
# replaces every occurrence of 'okay' with 'great' in file.txt, (regex compatible)
|
||||
sed -i 's/okay/great/g' file.txt
|
||||
# print to stdout all lines of file.txt which match some regex, the example prints lines which beginning with "foo" and end in "bar"
|
||||
# print to stdout all lines of file.txt which match some regex, the example prints lines which begin with "foo" and end in "bar"
|
||||
grep "^foo.*bar$" file.txt
|
||||
# pass the option "-c" to instead print the number of lines matching the regex
|
||||
grep -c "^foo.*bar$" file.txt
|
||||
|
@ -5,6 +5,7 @@ contributors:
|
||||
- ["Adam Bard", "http://adambard.com/"]
|
||||
- ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"]
|
||||
- ["Jakub Trzebiatowski", "http://cbs.stgn.pl"]
|
||||
- ["Marco Scannadinari", "https://marcoms.github.io"]
|
||||
|
||||
---
|
||||
|
||||
@ -21,6 +22,10 @@ memory management and C will take you as far as you need to go.
|
||||
Multi-line comments look like this. They work in C89 as well.
|
||||
*/
|
||||
|
||||
/*
|
||||
Multi-line comments don't nest /* Be careful */ // comment ends on this line...
|
||||
*/ // ...not this one!
|
||||
|
||||
// Constants: #define <keyword>
|
||||
#define DAYS_IN_YEAR 365
|
||||
|
||||
@ -74,10 +79,10 @@ int main() {
|
||||
long long x_long_long = 0;
|
||||
|
||||
// floats are usually 32-bit floating point numbers
|
||||
float x_float = 0.0;
|
||||
float x_float = 0.0f; // 'f' suffix here denotes floating point literal
|
||||
|
||||
// doubles are usually 64-bit floating-point numbers
|
||||
double x_double = 0.0;
|
||||
double x_double = 0.0; // real numbers without any suffix are doubles
|
||||
|
||||
// Integral types may be unsigned.
|
||||
unsigned short ux_short;
|
||||
|
@ -126,6 +126,14 @@ render the numbers in order, but this may not be a good idea -->
|
||||
* Sub-item
|
||||
4. Item four
|
||||
|
||||
<!-- There are even task lists. This creates HTML checkboxes. -->
|
||||
|
||||
Boxes below without the 'x' are unchecked HTML checkboxes.
|
||||
- [ ] First task to complete.
|
||||
- [ ] Second task that needs done
|
||||
This checkbox below will be a checked HTML checkbox.
|
||||
- [x] This task has been completed
|
||||
|
||||
<!-- Code blocks -->
|
||||
<!-- You can indicate a code block (which uses the <code> element) by indenting
|
||||
a line with four spaces or a tab -->
|
||||
|
Loading…
Reference in New Issue
Block a user