Skip to content

Instantly share code, notes, and snippets.

View tinovyatkin's full-sized avatar
💭
I may be slow to respond.

Konstantin Vyatkin tinovyatkin

💭
I may be slow to respond.
View GitHub Profile
@tinovyatkin
tinovyatkin / amz_linux_git.md
Created November 13, 2023 16:54 — forked from rjhintz/amz_linux_git.md
AWS Linux: Git Install From Source

AWS Linux: Installing Git from Source

Method

Method:

  1. sudo yum update
  2. sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
  3. sudo yum install asciidoc xmlto docbook2X
  4. sudo yum install gcc autoconf
  5. sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
  6. wget https://github.com/git/git/archive/v2.8.4.zip
"""
Reorder site-packages ahead of Extras and lib-dynload.
Two implementations:
1. puts site-packages ahead of stdlib (technically hazardous,
but not really an issue).
2. is more conservative, only demoting Extras below site-packages.
Add this to ~/Library/Python/2.7/lib/python/site-packages/sitecustomize.py
"""
#!/bin/bash
sudo yum install gcc -y
sudo yum install openssl-devel -y
sudo yum install zlib-devel -y
sudo yum install mlocate -y
sudo yum install autoconf -y
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
tar zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1
./configure --prefix=/usr
@tinovyatkin
tinovyatkin / webpack-https-mkcert.md
Last active August 17, 2023 11:42 — forked from Grawl/webpack-https-mkcert.md
Running Webpack Dev Server with HTTPS on developer machine using MKCERT
  1. Add local domain to /etc/hosts:

    127.0.0.1 my-project.dev

  2. Install mkcert

  3. Create certificate for this domain:

    ➜ mkcert my-project.dev
@tinovyatkin
tinovyatkin / lambda.ts
Last active July 27, 2023 11:13 — forked from streamich/lambda.js
using node-postgres (`pg`) in AWS Lambda
import type { Handler } from "aws-lambda";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
});
{
"type": "object",
"required": ["Statement"],
"additionalProperties": false,
"properties": {
"Version": {
"type": "string",
"enum": ["2008-10-17", "2012-10-17"]
},
"Id": {
@tinovyatkin
tinovyatkin / list.ts
Created February 23, 2022 14:03
list format
function namesList(names: string | readonly string[]): string {
if (typeof names === 'string') return names;
if (names instanceof Array) return names.join(', ');
throw new TypeError(
`Invalid parameter, expected a string or array of strings, received: ${names}`,
);
}
const nameList2 = (names: string | Iterable<string>) =>
typeof names === 'string'
@tinovyatkin
tinovyatkin / getAllImports.ts
Last active December 3, 2023 11:40
Getting all imported modules names from a JS file using TypeScript parser
import { readFileSync } from 'fs';
import { builtinModules } from 'module';
import ts from 'typescript';
const tsHost = ts.createCompilerHost(
{
allowJs: true,
noEmit: true,
isolatedModules: true,

Keybase proof

I hereby claim:

  • I am tinovyatkin on github.
  • I am tinovyatkin (https://keybase.io/tinovyatkin) on keybase.
  • I have a public key ASB7vAUOzsyh3hE4oZr2HhnRNLmP9qEdaFb-pqDXAkdstAo

To claim this, I am signing this object:

@-moz-document domain("github.com") {
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;1,100;1,200;1,300;1,400;1,500;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;1,100;1,200;1,300;1,400;1,500;1,600&display=swap');
body {
font-family: "Ubuntu" !important;
font-variant-ligatures: normal;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: subpixel-antialiased;