r.dbCreate('mydb')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function digPow(n, p){ | |
| const digits = n.toString().split('').map(Number); | |
| let sum = 0; | |
| digits.forEach(digit => { | |
| sum += Math.pow(digit , p); | |
| p++; | |
| }) | |
| return sum % n ? -1 : sum/n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function tribonacci(n) { | |
| let seq = [1,1,1]; | |
| let index; | |
| for (let i = 3; i < n; i++) { | |
| seq.push(seq[seq.length - 1] + seq[seq.length - 2] + seq[seq.length - 3]) | |
| } | |
| console.log(seq) | |
| return seq.slice(0, n); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const str = "Yeah_so_many_underscores here"; | |
| // const str = "A-B-C"; | |
| // const newStr = str.replace(/_/g, " "); | |
| const newStr = str.replace(/[_!@#$%^&*, -]/g, " "); | |
| const arr = newStr.split(' '); | |
| // remove first word | |
| let arr1 = arr.slice(0,1) | |
| let arr2 = arr.slice(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getHitProbability(R, C, G) { | |
| // Write your code here | |
| let empty = 0; | |
| let filled = 0; | |
| let tot = R*C | |
| for(let i = 0; i < R; i++){ | |
| for(let j = 0; j < C; j++){ | |
| G[i] && G[i][j] === 1 ? filled++ : empty++ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const Countries = [ | |
| { ru:"Афганистан",lt:"Afganistanas",tr:"Afganistan", en: 'Afghanistan', flag: '🇦🇫', code: 'AF', dialCode: '+93', mask: '999 999 9999' }, | |
| { ru:"Аландские острова",lt:"Alandų salos",tr:"Aland adaları", en: 'Åland Islands', flag: '🇦🇽', code: 'AX', dialCode: '+358', mask: '999 9999999' }, | |
| { ru:"Албания",lt:"Albanija",tr:"Arnavutluk", en: 'Albania',flag: '🇦🇱',code: 'AL', dialCode: '+355', mask: '999 999 9999' }, | |
| { ru:"Алжир",lt:"Alžyras",tr:"Cezayir", en: 'Algeria',flag: '🇩🇿',code: 'DZ', dialCode: '+213', mask: '9999 99 99 99' }, | |
| { ru:"американское Самоа",lt:"Amerikos Samoa",tr:"Amerikan Samoası", en: 'American Samoa',flag: '🇦🇸',code: 'AS', dialCode: '+1684', mask: '(999) 999-9999' }, | |
| { ru:"андорра",lt:"Andora",tr:"Andorra", en: 'Andorra',flag: '🇦🇩',code: 'AD', dialCode: '+376', mask: '999 999' }, | |
| { ru:"Ангола",lt:"Angoloje",tr:"Angora", en: 'Angola',flag: '🇦🇴',code: 'AO', dialCode: '+244', mask: '999 999 999' }, | |
| { ru:"Ангилья",lt:"Angilija",tr:"Anguilla", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| contract MyContract { | |
| string value; | |
| function get() public view returns (string memory) { | |
| return value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.7.0 <0.9.0; | |
| contract Marketplace { | |
| uint internal productsLength = 0; | |
| struct Product { | |
| address payable owner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * | |
| * This is an example implementation of a Flow Non-Fungible Token | |
| * It is not part of the official standard but it assumed to be | |
| * similar to how many NFTs would implement the core functionality. | |
| * | |
| * This contract does not implement any sophisticated classification | |
| * system for its NFTs. It defines a simple NFT with minimal metadata. | |
| * | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### MacPorts | |
| # requires the pkg to be present, ignore if already installed | |
| xcode-select --install | |
| sudo xcodebuild -license | |
| sudo installer -pkg MacPorts-2.7.1-11-BigSur.pkg -target / | |
| sudo port selfupdate | |
| ### VS Code | |
| # requires the app directory, ignore if already installed | |
| sudo cp -r 'Visual Studio Code.app' /Applications/ |