Skip to content

Instantly share code, notes, and snippets.

View leodevbro's full-sized avatar
Soccer and Table tennis

Levan Katsadze leodevbro

Soccer and Table tennis
View GitHub Profile
@leodevbro
leodevbro / simplified-version-of-reading-mbox-file.js
Last active November 14, 2024 00:51
This is a simplified version of accessing some values (sender, receiver, cc, bcc, attachments size...) of mails inside mbox file.
import nodeMbox from 'node-mbox';
import { simpleParser } from 'mailparser';
import { createReadStream } from 'node:fs';
const mboxFilePath = './All mail Including Spam and Trash.mbox';
const scanHeaders = (headersMap) => {
const headers = headersMap;
const init_From = headers.get('from');
@leodevbro
leodevbro / gist:64b8fd11afc6c226e550a3ae4e31e1ae
Created February 18, 2024 21:59
Full text of the GotQuestions special question
Maybe I'm wrong, but I think the GotQuestions official answer of "What does the Bible say about extreme fighting?" has false conclusion.
Please read my arguments and then tell me your opinion about them.
So, I see: "the Bible does not give any hard-and-fast reason why a Christian cannot enjoy or participate in martial arts or the sport of mixed martial arts (MMA). "
I think, the principles in the Bible tells us that it is a sin to hurt each other physically for the sake of show/entertainment and/or money. I’m not talking about the combat sports which do not contain high risk of permanent physical damage, like brain damage. I am talking about the today’s popular MMA fights, and boxing fight, and other kinds of fights, because I believe that today’s MMA fights and boxing fights contain very high risk of permanent brain damage, as well as high risks of other permanent physical damage.
Here are my arguments:
@leodevbro
leodevbro / special-task-solution.ts
Created January 6, 2023 18:38
Special Task Solution
// more readable and maintainable (I converted it to TypeScript)
const makeLowerCaseAndfindLongWordsInReverseOrder = (text: string) => {
const lowerCased = text.toLocaleLowerCase();
const words = lowerCased.split(" ");
words.reverse();
const trimmedWords = words.map((w) => w.trim());
const longWords = trimmedWords.filter((w) => w.length > 5);
@leodevbro
leodevbro / vs-code-marketplace-api-get-info-of-all-extensions.ts
Last active April 10, 2023 07:48
VS Code Marketplace API - Get Info Of All Extensions
// Source:
// https://github.com/badges/shields/blob/master/services/visual-studio-marketplace/visual-studio-marketplace-base.js
// Base Url of VS Code Marketplace API:
const baseUrl = `https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery?api-version=3.0-preview.1`;
interface IOneExtensionForFlag256 {
publisher: {
publisherId: string; // "998b010b-e2af-44a5-a6cd-0b5fd3b9b6f8"
publisherName: string; // "ms-python"
@leodevbro
leodevbro / gmail_threads_stats_original_code.gs
Created November 29, 2022 21:47
Original gmail stats code
// Google Apps Script is a coding language based on JavaScript.
// This Apps Script code helps us to sort addresses by most threads.
// A thread is a group of messages, as a conversation.
const modes = {
inbox: "inbox", // to analyze threads in the "inbox" folder
outbox: "outbox", // to analyze threads in the "sent" folder
};
const currentMode = modes.inbox; // type 'outbox' if you want to analyze threads in the "sent" folder.
@leodevbro
leodevbro / gmail-stats.gs
Last active April 25, 2024 05:21
In Gmail inbox, Find sender with most mail threads
// Original script: https://gist.github.com/leodevbro/2987e8874a18b2086ea6cc1aa3c494e8
// v2.5
// Google Apps Script is a coding language based on JavaScript.
// This Apps Script code helps us to sort addresses by most threads.
// A thread is a group of messages, as a conversation.
const modes = {
inbox: "inbox", // to analyze threads in the "Inbox" folder
outbox: "outbox", // to analyze threads in the "Sent" folder
@leodevbro
leodevbro / react-into-single-file.md
Last active September 1, 2022 10:06
How to generate single file (HTML with all the CSS/JS inside) from React project

How to generate single file (HTML with all the CSS/JS inside) from React project

Note:

  • SVG files will be included (as SVG elements) in the single file.
  • Pixel based image files will be included as links/paths, so please host them somewhere to be accessible.
  • Also please host font files somewhere and then link them with @font-face.

Steps:

  • npm install --save-dev gulp gulp-inline-source gulp-replace
@media screen and (min-width: 1281px) {
.slider-header.slider-header.slider-header {
inset: 22% auto auto 40%;
align-items: center;
}
.slider-header.slider-header.slider-header h2 {
margin-right: 0px;
}
}
/* eslint-disable @typescript-eslint/naming-convention */
// import * as path from "path";
// import * as vscode from "vscode";
import { IExtensionPackage, IGrammar } from "./IExtensionGrammar";
// import fs = require("fs");
import { getRegexForBrackets } from "./bracketUtil";
// import JSON5 = require("json5");
import * as JSON5 from "json5";
import LanguageConfig from "./languageConfig";
// var ab2str = require("arraybuffer-to-string");
// 1)
console.log(3, typeof 3); // 3 "number"
console.log("a", typeof "a"); // "a" "string"
console.log(2, typeof 2, "a", typeof "a"); // 2 "number" "a" "string"
// 2) Recursion