Skip to content

Instantly share code, notes, and snippets.

@Rudchyk
Rudchyk / .gitignore
Last active August 11, 2025 05:24
[realfavicongenerator](https://realfavicongenerator.net/) ``` npx create-next-app@latest ```
dist
User-agent: *
Disallow:
@Rudchyk
Rudchyk / .env
Last active August 1, 2025 14:14
## [Next.js](https://nextjs.org/docs/app/getting-started/installation) ```bash npx create-next-app@latest ``` ## [NextAuth.js](https://next-auth.js.org/getting-started/example) ```bash npm install next-auth ``` ## Optional for components ### [MUI](ht
AUTH_USER_EMAIL=test@gmail.com
AUTH_USER_PASS=11111
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=replace-with-a-long-random-string
@Rudchyk
Rudchyk / sc.js
Created June 19, 2025 12:40
`node ./sc.js`
const data = require('./snaphots.json');
const fs = require('fs');
const boo = data.map(({date, fundsExchanges, funds, notionalCcy, additionalFunds}) => {
return {
date,
notionalCcy,
fundsExchanges,
additionalFunds,
funds: funds.map(({ id, prices, createdAt, updatedAt, ltv, liqPx, ...other}) => {
@Rudchyk
Rudchyk / view_random_image.py
Last active May 15, 2025 04:44
- [Step 1](https://snippets.cacher.io/snippet/bb74ce87c3f1168b73a8) - Use: ```py img = view_random_image(target_dir="pizza_steak/train/", target_class="pizza") ``` ```text ['269396.jpg'] Image shape: (512, 384, 3) ``` - Пока
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import random
def view_random_image(target_dir, target_class):
# Setup the target directory (we'll view images from here)
target_folder = target_dir+target_class
# Get a random image path
random_image = random.sample(os.listdir(target_folder), 1)
@Rudchyk
Rudchyk / zip.py
Last active May 15, 2025 04:17
- `!ls pizza_steak` - Показати всі файли в папці (! для виведення всього стрічко.) - `!ls pizza_steak/train/` ```text test train ``` - `!ls -la pizza_steak` - Показати всі файли в папці разом з даними і схованими файлама ```text total 16 drwxr-xr-x
import zipfile
!wget https://storage.googleapis.com/ztm_tf_course/food_vision/pizza_steak.zip
# Unzip the downloaded file
zip_ref = zipfile.ZipFile("pizza_steak.zip")
zip_ref.extractall()
zip_ref.close()
  • in <install directory>/bin/mongod.cfg
  • add:
replication: replSetName: rs0
  • restart mongo service in admin cmd (or reboot):
  • sc stop MongoDb
  • sc start MongoDb
  • in mongo shell (mongosh): rs.initiate()
npx create-react-app my-app --template typescript
npm install @mui/material @emotion/react @emotion/styled
npm install @mui/icons-material
const fs = require('fs')
const data = fs.readFileSync('./networks.json').toString();
const sourceData = JSON.parse(data);
const networks = fs.readFileSync('./networks-list.json').toString();
const sourceNetworks = JSON.parse(networks);
const networksMapping = Object.fromEntries(sourceNetworks.map(({ wallet, network }) => [wallet, network]))
const normalized = sourceData.map((item) => ({
...item,
asset_identifier: item.asset_identifier || item.symbol,
@Rudchyk
Rudchyk / Button.md
Last active December 20, 2024 04:23
import Button, { ButtonProps } from '@mui/material/Button';
import NextLink from 'next/link';
import { LoadingButton } from '@mui/lab'
LinkComponent={NextLink}