This file contains 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
/* | |
* * STRUCTURE [EN] | |
* - .: Character used to separate the path of Keys/Fields. (key.key.key...) | |
* | |
* * YAPI [TR] | |
* - .: Anahtarların/Alanların yolunu ayırmak için kullanılan karakter. (key.key.key...) | |
* | |
* * USAGE EXAMPLE / KULLANIM ÖRNEĞİ | |
* setByPathOfObject("document.customField.meta.value", 28) | |
* => { document: { customField: { meta: { value: 28 } } } } |
This file contains 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
/* | |
* * STRUCTURE [EN] | |
* - .: Character used to separate the path of Keys/Fields. (key.key.key...) | |
* - [<number>]: The character used to return the relevant element of the Array type data. | |
* - >: Character used to search (find method) in Array type data. | |
* - :: The character that expresses the condition field in the find operation specified by the > character of the data of type Array. (...>CONDITIONFIELD:...) | |
* - <: It is the character that expresses the value that the field expressed with : must be equal in the find operation determined by the > character of the data in Array type. (...>CONDITIONFIELD:EXPECTEDTOEQUALCONDITION<...) | |
* | |
* * YAPI [TR] | |
* - .: Anahtarların/Alanların yolunu ayırmak için kullanılan karakter. (key.key.key...) |
This file contains 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
/** | |
* Flat JSON Yapısı: <json|group,key,value> | |
* group <string>: Anahtarlanmış birden fazla değeri gruplamak için kullanılan ifadedir. | |
* Eğer işaretçiye ait bir grup ise işaretçinin group değeri ve key değeri ile isimlendirilmelidir. (group.key) | |
* key <string>: Anahtar ifadesidir. JSON içinde benzersiz olmalıdır. | |
* Eğer başka bir grubu işaret edecekse group ve key isimlerinin birleşiminden oluşan grup (group) tanımlanmalıdır. (group.key) | |
* value <string>: Anahtarlanan ifadenin tuttuğu değerdir. Eğer başka bir grubu (group) işaret edecekse "*" (pointer) değerini alır. | |
* Örn: [ | |
* ... | |
* { "group": "anaKategori", "key": "TEST KATEGORİ", "value": "*" }, |
This file contains 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 isPrime(first, last) { | |
let out = [] | |
if(last < first) [first, last] = [last, first] | |
const fin = last - first | |
let num = first - 1 | |
while(num++ < fin) { | |
(function() { | |
const boundary = Math.floor(Math.sqrt(num)) | |
for (var i = 2; i <= boundary; i++) if (num % i === 0) return false | |
if(num >= 2) out.push(num) |
This file contains 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
db.demo.aggregate([ | |
{ | |
$project: { | |
allData: { | |
$let: { | |
vars: { data: { "$objectToArray": "$$ROOT" } }, | |
in: { | |
$filter: { | |
input: "$$data", | |
as: "item", |
This file contains 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 place = ["", "bin", "milyon", "milyar", "trilyon", "katrilyon"] | |
const digets = [ | |
[['sıfır'], ['yüz'], ['ikiyüz'], ['üçyüz'], ['dörtyüz'], ['beşyüz'], ['altıyüz'], ['yediyüz'], ['sekizyüz'], ['dokuzyüz']], | |
[['sıfır'], ['on'], ['yirmi'], ['otuz'], ['kırk'], ['elli'], ['altmış'], ['yetmiş'], ['seksen'], ['doksan']], | |
[['sıfır'], ['bir'], ['iki'], ['üç'], ['dört'], ['beş'], ['altı'], ['yedi'], ['sekiz'], ['dokuz']] | |
] | |
const read3DigitNum = (num) => num.padStart(3, "_").split("").flatMap((y, i) => y === "_" ? [] : y === "0" && i > 0 && Number(num.slice(0, i)) != 0 ? [] : digets[i][y]).join("") | |
const chunk = (str, size, rtl = false) => rtl | |
? str.split('').flatMap((x, i) => { return i % size ? [] : str.slice(Math.max(str.length - i - 3, 0), str.length - i) }).reverse() | |
: str.split('').flatMap((x, i) => { return i % size ? [] : str.slice(i, i + size) }) |
This file contains 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 numberToTextLookup = [ | |
{ "0": "Sıfır", "1": "Yüz", "2": "İkiyüz", "3": "Üçyüz", "4": "Dörtyüz", "5": "Beşyüz", "6": "Altıyüz", "7": "Yediyüz", "8": "Sekizyüz", "9": "Dokuzyüz", "undefined": " " }, | |
{ "0": "Sıfır", "1": "On", "2": "Yirmi", "3": "Otuz", "4": "Kırk", "5": "Elli", "6": "Atmış", "7": "Yetmiş", "8": "Seksen", "9": "Doksan", "undefined": " " }, | |
{ "0": "Sıfır", "1": "Bir", "2": "İki", "3": "Üç", "4": "Dört", "5": "Beş", "6": "Altı", "7": "Yedi", "8": "Sekiz", "9": "Dokuz", "undefined": " " } | |
] | |
function numberToText(number, digit = 3) { | |
number = +number | |
if(isNaN(number) || digit > 3 || digit < 0) return "" |
This file contains 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
<!DOCTYPE html> | |
<html lang="tr"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css"> |
This file contains 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
#! /bin/bash | |
npm version major | |
npm publish # update latest version | |
# npm publish --tag old-version # not update latest version | |
git push --follow-tags |
This file contains 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
#! /bin/bash | |
BOLD="\e[1m" | |
NORMAL="\e[0m" | |
DEFAULT="\e[39m" | |
RED="\e[31m" | |
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | |
if [ "$SCRIPTPATH" = "$PWD" ];then | |
css="" |
NewerOlder