Tutorial by Examples: l

Break and continue statements can be followed by an optional label which works like some kind of a goto statement, resumes execution from the label referenced position for(var i = 0; i < 5; i++){ nextLoop2Iteration: for(var j = 0; j < 5; j++){ if(i == j) break nextLoop2Iteration; ...
console.time() can be used to measure how long a task in your code takes to run. Calling console.time([label]) starts a new timer. When console.timeEnd([label]) is called, the elapsed time, in milliseconds, since the original .time() call is calculated and logged. Because of this behavior, you can ...
Log into your AWS Console and click on Lambda under the Services tab. Under Functions you'll be able to Create a Lambda function using the same-labeled button. You'll be shown a screen where you can select a blueprint. These are simply starting points to existing Lambda functions fo...
When using async await in loops, you might encounter some of these problems. If you just try to use await inside forEach, this will throw an Unexpected token error. (async() => { data = [1, 2, 3, 4, 5]; data.forEach(e => { const i = await somePromiseFn(e); console.log(i); }); ...
/// <summary> /// Gets displayName from DataAnnotations attribute /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <pa...
/// <summary> /// Creates simple button /// </summary> /// <param name="poHelper"></param> /// <param name="psValue"></param> /// <returns></returns> public static MvcHtmlString SubmitButton(this HtmlHelper poHelper, string ps...
Using the collect() helper, you can easily create new collection instances by passing in an array such as: $fruits = collect(['oranges', 'peaches', 'pears']); If you don't want to use helper functions, you can create a new Collection using the class directly: $fruits = new Illuminate\Support\Co...
AngularJS has digest loop and all your functions in a view and filters are executed every time the digest cycle is run. The digest loop will be executed whenever the model is updated and it can slow down your app (filter can be hit multiple times, before the page is loaded). You should avoid this: ...
In other frameworks pagination is headache. Laravel makes it breeze, it can generate pagination by adding few lines of code in Controller and View. Basic Usage There are many ways to paginate items, but the simplest one is using the paginate method on query builder or an Eloquent query. Laravel ou...
Using a CDN: <!DOCTYPE html> <head> <script src="https://cdn.jsdelivr.net/rxjs/4.1.0/rx.min.js"></script> </head> <body> <script> // `Rx` is available var one$ = Rx.Observable.of(1); var onesub = one$.subscribe(function (...
Each domain supported in the app needs to make available its own apple-app-site-association file. If the content served by each domain is different, then the contents of the file will also change to support the respective paths. Otherwise, the same file can be used, but it needs to be accessible at ...
Note: You can skip this part if your server uses HTTPS to serve content and jump to Application Setup guide. If your app targets iOS 9 and your server uses HTTPS to serve content, you don’t need to sign the file. If not (e.g. when supporting Handoff on iOS 8), it has to be signed using a SSL certif...
The setup on the app side requires two things: Configuring the app’s entitlement, and enabling the universal links by turning on the Associated Domains capability in the project. Handling Incoming Links in your AppDelegate. 1. Configuring the app’s entitlement, and enabling universal links. ...
Mage::log('My log entry', null, 'mylogfile.log'); This wil log to /var/log/mylogfile.log
Mage::log('My log entry'); Mage::log('My log message: '.$myVariable); Mage::log($myArray); Mage::log($myObject); This will log to /var/log/system.log Objects and Arrays are automatically written via a print_r() directive. Watch out when using objects since these can get substantial in size. ...
Detailed instructions on getting facebook-graph-api set up or installed.
A common usecase for the ready() hook is to access the DOM, e.g. to initiate a Javascript plugin, get the dimensions of an element etc. The problem Due to Vue's asynchronous DOM update mechanism, it's not guaranteed that the DOM has been fully updated when the ready() hook is called. This usually ...
PHP provides an alternative syntax for some control structures: if, while, for, foreach, and switch. When compared to the normal syntax, the difference is, that the opening brace is replaced by a colon (:) and the closing brace is replaced by endif;, endwhile;, endfor;, endforeach;, or endswitch;, ...
while loop iterates through a block of code as long as a specified condition is true. $i = 1; while ($i < 10) { echo $i; $i++; } Output: 123456789 For detailed information, see the Loops topic.
do-while loop first executes a block of code once, in every case, then iterates through that block of code as long as a specified condition is true. $i = 0; do { $i++; echo $i; } while ($i < 10); Output: `12345678910` For detailed information, see the Loops topic.

Page 182 of 861