I hereby claim:
- I am nhatnx on github.
- I am nhatnx (https://keybase.io/nhatnx) on keybase.
- I have a public key whose fingerprint is B832 DC09 F93F D97E BDA8 6EBF 033F 0A9F 0C44 6A2E
To claim this, I am signing this object:
/* | |
Something likes find_in_set('a,b,c', 'a,b,c,d') | |
We can use OR: | |
find_in_set('a', 'a,b,c,d') OR find_in_set('b', 'a,b,c,d') OR find_in_set('b', 'a,b,c,d') | |
*/ | |
WHERE CONCAT(",", `setcolumn`, ",") REGEXP ",(val1|val2|val3)," |
I hereby claim:
To claim this, I am signing this object:
DELETE t1 FROM table t1 | |
INNER JOIN table t2 | |
ON t2.refID = t1.refID | |
AND t2.ID < t1.ID |
// by_value_of_key | |
// e.g. array = [{index: 3, sortProp: 'aaa'}, {index: 1, sortProp: 'ccc'}, {index: 2, sortProp: 'bbb'}] | |
var sortProp = "keyToSortByItsValues" | |
array.sort(function (left, right) { | |
let a = left[sortProp]; | |
let b = right[sortProp]; | |
if (a !== b) { | |
if (a > b || a === void 0) return -1; | |
if (a < b || b === void 0) return 1; | |
} |
<?php | |
$values = []; | |
foreach ($nodes as $node) { | |
$values[] = [ | |
'name' => $node['name'], | |
'birthDate' => $node['birthDate'] | |
]; | |
} |
Getting started:
Related tutorials:
// To break a <var>$.each</var> loop, you have to <var>return false</var> in the loop callback. | |
// Returning <var>true</var> skips to the next iteration, equivalent to a <var>continue</var> in a normal loop. | |
$.each(array, function(key, value) { | |
if(value === "foo") { | |
return false; | |
} | |
}); |
<?php | |
if (($key = array_search($del_val, $messages)) !== false) { | |
unset($messages[$key]); | |
} | |
?> |
<?php | |
$content = trim(preg_replace('/<p>(\s+| )+<\/p>/', ' ', $content)); | |
?> |
.element { | |
pointer-events: none; | |
} |