Skip to content

Instantly share code, notes, and snippets.

View koistya's full-sized avatar
🏠
Working from home

Konstantin Tarkus koistya

🏠
Working from home
View GitHub Profile
@koistya
koistya / main.yml
Last active July 8, 2023 16:46
GitHub Actions Workflows (example)
# GitHub Actions Workflow (example)
# .github/workflows/main.yml
name: CI/CD
on:
push:
branches: [main]
tags:
- "v*"
@koistya
koistya / twitter-auth.md
Last active July 8, 2023 14:57
Twitter auth flow using Firebase Auth (a.k.a. Google Identity Platform)
@koistya
koistya / crypto.md
Last active July 8, 2025 23:25
Using Google Cloud credentials (service account keys) in Cloudflare Workers environment

Allow retrieving an OAuth 2.0 authentication token for interacting with Google services using the service account key.

Usage Example with Cloudflare Workers

Base64-encode your service account JSON key and save it to *.env files (GOOGLE_CLOUD_CREDENTIALS)

import { getAuthToken, Env } from "core";

export default {
interface PluginConfigTypes {
gtag: {
trackingID: string
}
otherPlugin: {
test: number
}
}
type Config<K extends keyof PluginConfigTypes> = {
/* SPDX-FileCopyrightText: 2021-present Konstantin Tarkus ([email protected]) */
/* SPDX-License-Identifier: MIT */
import * as React from "react";
import { TextField, Autocomplete } from "@mui/material";
import type { AutocompleteProps } from "@mui/material";
import { projects } from "./data";
type Option = { id: string; label: string };
type ComboboxProps = Omit<
@koistya
koistya / facebook-customer-chat-demo.jsx
Last active July 13, 2022 10:20
Facebook Customer Chat with Next.js
import { useState, Fragment } from 'react'
import Script from 'next/script'
/**
* Facebook Customer Chat demo
*
* @see https://nextjs.org/docs/api-reference/next/script
* @see https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin/sdk/
* @see https://developers.facebook.com/docs/javascript/reference/FB.init/
*/
@koistya
koistya / README.md
Created June 28, 2021 13:58 — forked from zhiguangwang/README.md
Installing and running shadowsocks on Ubuntu Server

Installing and running shadowsocks on Ubuntu Server

16.10 yakkety and above

  1. Install the the shadowsocks-libev package from apt repository.

     sudo apt update
     sudo apt install shadowsocks-libev
    
  2. Save ss.json as /etc/shadowsocks-libev/config.json.

Failed to load module '@vsintellicode/typescript-intellicode-plugin' from /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/node_modules: Error: Could not resolve JS module '@vsintellicode/typescript-intellicode-plugin' starting at '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/node_modules'. Looked in:
at Object.resolveJSModule (./.yarn/cache/typescript-patch-edef266e49-b8b689ef99.zip/node_modules/typescript/lib/tsserver.js:38253:19)
at Object.sys.require (./.yarn/cache/typescript-patch-edef266e49-b8b689ef99.zip/node_modules/typescript/lib/tsserver.js:157662:45)
at Function.Project.resolveModule (./.yarn/cache/typescript-patch-edef266e49-b8b689ef99.zip/node_modules/typescript/lib/tsserver.js:147790:35)
at ./.yarn/cache/typescript-patch-edef266e49-b8b689ef99.zip/node_modules/typescript/lib/tsserver.js:148867:36
at Object.firstDefined (./.yarn/cache/typescript-patch-edef266e49-b8b689ef99
import fs from "fs";
import knex from "knex";
import env from "./env";
export default knex({
client: "pg",
connection: {
ssl: env.PGSSLMODE === "verify-ca" && {
cert: fs.readFileSync(env.PGSSLCERT, "ascii"),
@koistya
koistya / remove-vk-content.md
Last active December 19, 2019 12:38
Как удалить все сообщения, фотки и видео ВКонтакте https://www.youtube.com/watch?v=sDYIn30ojFk

Как удалить все фотографии ВКонтакте

Заходим в "Фотографии", открываем первую фотографию в списке и запускаем скрипт в консоли браузера:

while (true) {
  // Удалить открытую фотографию
  Photoview.deletePhoto();