Tutorial by Examples: er

Parentheses are needed to avoid ambiguity: foo 1 |> bar 2 |> baz 3 Should be written as: foo(1) |> bar(2) |> baz(3)
String.prototype.toUpperCase(): console.log('qwerty'.toUpperCase()); // 'QWERTY'
String.prototype.toLowerCase() console.log('QWERTY'.toLowerCase()); // 'qwerty'
To generate an XML documentation file from documentation comments in the code, use the /doc option with the csc.exe C# compiler. In Visual Studio 2013/2015, In Project -> Properties -> Build -> Output, check the XML documentation file checkbox: When you build the project, an XML file wi...
Say you have a <textarea> and you want to retrieve info about the number of: Characters (total) Characters (no spaces) Words Lines function wordCount( val ){ var wom = val.match(/\S+/g); return { charactersNoSpaces : val.replace(/\s+/g, '').length, characte...
php artisan route:list --method=GET --method=POST This will include all routes that accept GET and POST methods simultaneously.
In normal mode: ~ inverts the case of the character under the cursor, gu{motion} lowercases the text covered by {motion}, gU{motion} uppercases the text covered by {motion} Example (^ marks the cursor position): Lorem ipsum dolor sit amet. ^ Lorem ipSum dolor sit amet. ~ Lorem...
The UPPER function allows you to convert all lowercase letters in a string to uppercase. SELECT UPPER('My text 123!') AS result FROM dual; Output: RESULT ------------ MY TEXT 123!
Summary This goal is to reorganize all of your scattered commits into more meaningful commits for easier code reviews. If there are too many layers of changes across too many files at once, it is harder to do a code review. If you can reorganize your chronologically created commits into topical com...
git log --after '3 days ago' Specific dates work too: git log --after 2016-05-01 As with other commands and flags that accept a date parameter, the allowed date format is as supported by GNU date (highly flexible). An alias to --after is --since. Flags exist for the converse too: --before ...
Itertools "islice" allows you to slice a generator: results = fetch_paged_results() # returns a generator limit = 20 # Only want the first 20 results for data in itertools.islice(results, limit): print(data) Normally you cannot slice a generator: def gen(): n = 0 wh...
Exception handling occurs based on an exception hierarchy, determined by the inheritance structure of the exception classes. For example, IOError and OSError are both subclasses of EnvironmentError. Code that catches an IOError will not catch an OSError. However, code that catches an EnvironmentErr...
If I wanted to find out the sum of numbers from 1 to n where n is a natural number, I can do 1 + 2 + 3 + 4 + ... + (several hours later) + n. Alternatively, I could write a for loop: n = 0 for i in range (1, n+1): n += i Or I could use a technique known as recursion: def recursion(n): ...
While reading content from a file is already asynchronous using the fs.readFile() method, sometimes we want to get the data in a Stream versus in a simple callback. This allows us to pipe this data to other locations or to process it as it comes in versus all at once at the end. const fs = require(...
To find some number (more than one) of largest or smallest values of an iterable, you can use the nlargest and nsmallest of the heapq module: import heapq # get 5 largest items from the range heapq.nlargest(5, range(10)) # Output: [9, 8, 7, 6, 5] heapq.nsmallest(5, range(10)) # Output: [...
Inspecting system resource usage is an efficient way to narrow down a problem on a live running application. This example is an equivalent of the traditional ps command for containers. docker top 7786807d8084 To filter of format the output, add ps options on the command line: docker top 7786807...
'Attaching to a container' is the act of starting a terminal session within the context that the container (and any programs therein) is running. This is primarily used for debugging purposes, but may also be needed if specific data needs to be passed to programs running within the container. The a...
In this example, 2.13.2 is the latest version. We install it via bower, specifying the particular version as ember#2.13.2 and including the save flag to persist it to bower.json. As of writing this post the latest version is 2.13.2. From the command line, in the root of your app's directory, run: ...
Since Ember Data is an Ember CLI add-on we can install it just like any other add-on by using ember install. As of writing this post the latest version is 2.13.1. From the command line, in the root of your app's directory, run: ember install [email protected]
Ember CLI is a normal npm package. To update it we have to uninstall it and then install the version we want. As of writing this post the latest version is 2.13.2. From the command line run: npm uninstall -g ember-cli npm cache clean bower cache clean npm install -g [email protected] To verif...

Page 66 of 417