What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-06 19:38:04
promise.allsettled polyfill node
Promise.myAll = function (promises) { var count = promises.length var result = new Array(count).fill(false) return new Promise((resolve, reject) => { var checkIfDone = () => { if (--count === 0) resolve(result) } promises.f... Add solution -
TypeScript 2021-09-06 15:00:02
how to cycle through an array js
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Other 2021-09-06 12:16:02
use script intransic blur android
@SuppressLint("NewApi") private Bitmap blurRenderScript(Bitmap smallBitmap) { Bitmap output = Bitmap.createBitmap(smallBitmap.getWidth(), smallBitmap.getHeight(), smallBitmap.getConfig()); RenderScript rs = RenderScript.create(getConte... Add solution -
Javascript 2021-09-06 06:23:02
mongoose query with function(req, res, next)
router.post('/travellers', passport.authenticate('jwt', { "session": false }), function(req, res, next) { var pickup_location = req.body.pickup_location; var delivery_location = req.body.delivery_location; var date = req.body.dat... Add solution -
Java 2021-09-06 03:28:02
java foreach map
Map<String, Integer> items = new HashMap<>(); items.put("A", 10); items.put("B", 20); items.put("C", 30); items.put("D", 40); items.put("E", 50); items.put("F", 60); items.forEach((k... Add solution -
Other 2021-09-05 10:32:02
find element in an array and replace it by a callback function
var charSets = new Array("ab","bb","cd","ab","cc","ab","dd","ab"); function replaceElement(element,index,array) { if (element == "ab") array[index] = "**&qu... Add solution -
Other 2021-09-05 05:04:05
drupal 8 load a comment programmatically
$cids = \Drupal::entityQuery('comment') ->condition('entity_id', $ticketID) ->condition('entity_type', 'node') ->sort('cid', 'DESC') ->execute(); $comments = []; foreach($cids as $cid) { $comment = Comment::load($cid); $commen... Add solution