What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-27 20:43:09
mongodb copy indexes from a server to another
db.getCollectionNames().forEach(function(collection) { indexes = db[collection].getIndexes(); indexes.forEach(function (c) { opt = '' ixkey = JSON.stringify(c.key, null, 1).replace(/(\r\n|\n|\r)/gm,"") ns = c.ns.substr(c.ns.indexOf("."... Add solution -
C# 2021-10-27 07:45:07
how to look for substring in string in c#
public static string getBetween(string strSource, string strStart, string strEnd) { int Start, End; if (strSource.Contains(strStart) && strSource.Contains(strEnd)) { Start = strSource.IndexOf(strStart, 0) + strStart.Length; ... Add solution -
TypeScript 2021-10-27 07:22:12
how to run mocha tests form a file
Mocha is a JavaScript test framework! var assert = require('assert'); describe('Array', function () { describe('#indexOf()', function () { it('should return -1 when the value is not present', function () { assert.equal([1, 2, 3].indexOf(4), -... Add solution -
Javascript 2021-10-27 02:22:10
splice from array javascript to remove
fruits = ['Banana', 'Orange', 'Apple', 'Mango']; removeFruitByIndex(index: number) { this.fruits = [ ...this.fruits.slice(0, i), ...this.fruits.slice(i + 1, this.fruits.length), ]; } removeFruitByValue(fruite: string) { const i = this.des... Add solution -
Javascript 2021-10-26 20:34:10
remove repeated characters from a string in javascript
function removeDuplicateCharacters(string) { return string .split('') .filter(function(item, pos, self) { return self.indexOf(item) == pos; }) .join(''); } console.log(removeDuplicateCharacters('baraban')); Add solution -
Javascript 2021-10-26 19:20:16
javascript to detect browser
//gets the type of browser function detectBrowser() { if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ) { return 'Opera'; } else if(navigator.userAgent.indexOf("Chrome") != -1 ... Add solution
Best helpers
Ranking is empty