Press ESC
to make sure you are out of the edition mode and then type:
:wq
function errorFunction(){ | |
return Promise.reject('Reject value.'); | |
} | |
function goodFunction(error=false){ | |
return Promise.resolve('Resolved value.'); | |
} | |
// Example 1. One level | |
goodFunction().then(function(ok){ | |
console.log('First "then" called. Value: ', ok); |
<?php | |
add_filter( 'the_content', 'my_the_content_filter', 22 ); | |
function my_the_content_filter( $content ) { | |
if ( is_home() || is_archive() || is_search() ){ | |
// Mode word | |
$mode = 'sentence'; // word or sentence | |
$count = 11; |
/* | |
Theme Name: Turbo Surfing | |
Theme URI: # | |
Author: Team Perth | |
Author URI: # | |
Description: A theme for turbosurfing.com. | |
Version: 1.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
Text Domain: turbosurfing |
prefixLength - The number of pads before the first calendar day | |
suffixLength - The number of pads after the last calendar day | |
monthFirstWeekDay - The weekday of first month day. int 0-6 where 0 is Sunday and 6 is Saturday | |
monthLastWeekDay - he weekday of last month day. int 0-6 where 0 is Sunday and 6 is Saturday | |
calendarWeekStart - The weekday to which the calendar days start. int 0-6 where 0 is Sunday and 6 is Saturday | |
Pseudocode: | |
prefixLength = monthFirstWeekDay - calendarWeekStart |
@media screen and (min-width:100px) { /* Screen >= 100 */ | |
body { font-weight:bold; } | |
} | |
@media screen and (min-width:200px) { /* Screen >= 200 */ | |
body { color:#555; } | |
} | |
@media screen and (max-width:100px) { /* Screen <= 100 */ | |
body { font-weight:bold; } |
// IE >= 11 | |
function triggerEvent(el, eventName, options) { | |
var event, | |
opts = {detail: options}; | |
event = newEvent(eventName, opts); | |
el.dispatchEvent(event); | |
} | |
function newEvent(eventName, options) { |
type | min | max |
---|---|---|
i8 | -128 | 127 |
i16 | -32768 | 32767 |
i32 | -2147483648 | 2147483647 |
i64 | -9223372036854775808 | 9223372036854775807 |
u8 | 0 | 255 |
u16 | 0 | 65535 |
u32 | 0 | 4294967295 |
u64 | 0 | 18446744073709551615 |
SplPriorityQueue is advertised as a prioritized queue. Ideally, as a queue, when adding items of the same priority, the items should retain the same order as how they were registered (FIFO). In PHP the order is unexpected:
<?php
$queue = new SplPriorityQueue();
$queue->insert('1',0);
$queue->insert('2',0);
$queue->insert('3',0);
$queue->insert('4',0);