You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';This is quite common and very helpful. Another option is to do:
name || (name = 'joe');| <form data-abide> | |
| <div class="name-field"> | |
| <label>Your name <small>required</small></label> | |
| <input type="number" required pattern="[a-zA-Z]+"> | |
| <small class="error">Name is required and must be a string.</small> | |
| </div> | |
| <div class="email-field"> | |
| <label>Email <small>required</small></label> | |
| <input type="text" required pattern="email"> | |
| <small class="error">An email address is required.</small> |
You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';This is quite common and very helpful. Another option is to do:
name || (name = 'joe');| <?php | |
| class Product extends Eloquent { | |
| public function categories() | |
| { | |
| return $this->belongsToMany('Category'); | |
| } | |
| } |
| <?php | |
| /** | |
| * Gera a paginação dos itens de um array ou collection. | |
| * | |
| * @param array|Collection $items | |
| * @param int $perPage | |
| * @param int $page | |
| * @param array $options | |
| * | |
| * @return LengthAwarePaginator |
| <?php namespace App\Http\Controllers; | |
| use Illuminate\Pagination\LengthAwarePaginator; | |
| use Illuminate\Support\Collection; | |
| class SearchController extends Controller { | |
| public function search() | |
| { | |
| . |
| var video_events = { | |
| 'abort' : 'abort : The loading of an audio/video is aborted', | |
| 'canplay' : 'canplay : The browser can start playing the audio/video', | |
| 'canplaythrough' : 'canplaythrough : The browser can play through the audio/video without stopping for buffering', | |
| 'durationchange' : 'durationchange : The duration of the audio/video is changed', | |
| 'emptied' : 'emptied : The current playlist is empty', | |
| 'ended' : 'ended : The current playlist is ended', | |
| 'error' : 'error : An error occurred during the loading of an audio/video', | |
| 'loadeddata' : 'loadeddata : The browser has loaded the current frame of the audio/video', | |
| 'loadedmetadata' : 'loadedmetadata : The browser has loaded meta data for the audio/video', |
| /** | |
| * Brightcove HTML5 Player Google Analytics Tracker 1.0.0 Alpha (02 Sep 2012) | |
| * | |
| * REFERENCES: | |
| * Website: | |
| * Source: | |
| * | |
| * AUTHORS: | |
| * Darius Oleskevicius <doleskevicius@brightcove.com> | |
| * |
| // isAutoplaySupported(callback); | |
| // Test if HTML5 video autoplay is supported | |
| isAutoplaySupported = function(callback) { | |
| // Is the callback a function? | |
| if (typeof callback !== 'function') { | |
| console.log('isAutoplaySupported: Callback must be a function!'); | |
| return false; | |
| } | |
| // Check if sessionStorage exist for autoplaySupported, | |
| // if so we don't need to check for support again |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset='utf-8' /> | |
| <title></title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.js'></script> | |
| <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.css' rel='stylesheet' /> | |
| <link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> |
| [ | |
| { | |
| "code": "AAA", | |
| "lat": "-17.3595", | |
| "lon": "-145.494", | |
| "name": "Anaa Airport", | |
| "city": "Anaa", | |
| "state": "Tuamotu-Gambier", | |
| "country": "French Polynesia", |