Skip to content

Instantly share code, notes, and snippets.

View vmetnev's full-sized avatar

Vladislav Metnev vmetnev

View GitHub Profile
@vmetnev
vmetnev / writetoopenexcel.py
Created March 15, 2025 14:23
write to open excel
import pandas as pd
import win32com.client as win32
# Connect to the running instance of Excel
excel = win32.Dispatch("Excel.Application")
workbook = excel.Workbooks("Ex.xlsx") # Name of your workbook
sheet = workbook.Sheets("Q1") # Name of your sheet
# Write data to a specific cell
@vmetnev
vmetnev / bloomberg.md
Last active June 13, 2025 15:38
Bloomberg

=BDP(A6;"INTERVAL_HIGH";"start_date_override";"2024-12-31";"end_date_override";"2025-04-22")

=HYPERLINK("bbg://securities/AAPL%20US%20Equity/DES"; "Open AAPL DES")

=HYPERLINK("bbg://screens//NI"; "OPEN Semiconductors")

@vmetnev
vmetnev / notes.md
Last active January 3, 2025 14:15
Notes

Телемедицина для продукта - медицинского, любого в принципе как в HIMS US EQUITY

нужно сделать next.js from scratch в traversy.com

chrome + own server note holder

@vmetnev
vmetnev / writingOpenExcel.py
Created December 31, 2024 13:50
WritingOpenExcel
# python -m pip install --index-url=https://blpapi.bloomberg.com/repository/releases/python/simple/ blpapi
# python -m pip install pywin32
# pip install pypiwin32
# pip install win32com.client
import win32com.client as win32
# Connect to the running instance of Excel
excel = win32.Dispatch("Excel.Application")
@vmetnev
vmetnev / bloomQuery.py
Last active December 31, 2024 13:42
Bloomberg queries
# python3 -m pip install blp
# https://pypi.org/project/blp/
# https://matthewgilbert.github.io/blp/quickstart.html
import datetime
import json
import pandas
from blp import blp
@vmetnev
vmetnev / addPropertyToMongooseSchema.js
Created December 17, 2024 19:00
Dynamic add properties to Mongoose model
// Object to new mongoose schema and to save data in mongoDB from provided instance of an object
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
mongoose.set("strictQuery", false);
const database = {
uri: "mongodb://127.0.0.1:27017/",
name: "dayalayer",
user: "",
@vmetnev
vmetnev / postRequest.js
Last active April 8, 2024 16:48
POST request
getData()
async function getData() {
let url = "http://localhost:3001/test"
let resp = await fetch(url, {
method: "POST",
headers: {
"content-type": "application/json",
},
body: JSON.stringify({
name: "Vlad455",
@vmetnev
vmetnev / listMongooseConnections.js
Created April 8, 2024 16:40
List Mongoose Connections
mongooseConnect();
async function listCollections() {
let db = mongoose.connection.db;
const collections = await db.listCollections().toArray();
collections.forEach((collection) => console.log(collection.name));
db = mongoose.connection.db;
await db.collection("popcorn").rename("popcorn1").catch(error=>console.log(error.codeName))
@vmetnev
vmetnev / rssToJson.js
Last active March 12, 2024 13:55
rss xml to json
// first
import pkg from 'rss-to-json';
const {parse} = pkg;
rss()
async function rss () {
@vmetnev
vmetnev / mongoosemodelsAndSchemas.js
Last active February 29, 2024 11:33
Mongoose models and schemas
const mongoose = require("mongoose");
const {
Schema
} = mongoose;
const TickerSchema =
new Schema({
ticker: String,
date: String,
data: Schema.Types.Mixed,