Skip to content

Instantly share code, notes, and snippets.

View visortelle's full-sized avatar
🎯

Kiryl Valkovich visortelle

🎯
View GitHub Profile
@visortelle
visortelle / force-show-scrollbars-on-macos.ts
Created December 24, 2023 11:17
force-show-scrollbars-on-macos.ts
if (navigator.platform.match('Mac') !== null) {
const styleTag = document.createElement('style');
styleTag.innerHTML = `
/* MACOS SCROLLBAR FIX START
MacOS hides scrollbars by default.
This CSS forces to show scrollbar always.
It doesn't work in Firefox yet. */
::-webkit-scrollbar {
-webkit-appearance: none;
@visortelle
visortelle / README.md
Last active July 2, 2023 07:12
Aliases for Apache Pulsar CLI tools with JWT auth. Add it to your ~/.bashrc or ~/.zshrc.

Aliases for Apache Pulsar CLI tools with JWT auth

Usage

  • Add the pulsar-cli-aliases.shfile content to your ~/.bashrc or ~/.zshrc.
  • Fill pulsar_jwt, pulsar_url, pulsar_admin_url with your values.
  • Then use short commands like pa topics stats public/default/topic-a instead of
pulsar-admin \
time="2023-06-02 08:29:19" level=info msg=" [pipeline service] [pipeline #6] [task #15] start executing task: 15"
time="2023-06-02 08:29:19" level=info msg=" [pipeline service] [pipeline #6] [task #15] start plugin"
time="2023-06-02 08:29:19" level=info msg=" [pipeline service] [pipeline #6] [task #15] [api async client] creating scheduler for api "https://api.github.com/", number of workers: 13, 9500 reqs / 1h0m0s (interval: 378.947368ms)"
time="2023-06-02 08:29:20" level=info msg=" [pipeline service] [pipeline #6] [task #15] github graphql init success with remaining 5000/5000 and will reset at 2023-06-02 09:29:20 +0000 UTC"
time="2023-06-02 08:29:20" level=info msg=" [pipeline service] [pipeline #6] [task #15] total step: 24"
time="2023-06-02 08:29:20" level=info msg=" [pipeline service] [pipeline #6] [task #15] executing subtask collectApiMilestones"
time="2023-06-02 08:29:20" level=info msg=" [pipeline service] [pipeline #6] [task #15] [collectApiMilestones] start api collection"
time="2023-06-02 08:29:2
@visortelle
visortelle / task-7-1-1-github_graphql.log
Created May 31, 2023 13:22
DevLake logs - GitHub connection fails with 401
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] start executing task: 7"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] start plugin"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] [api async client] creating scheduler for api "https://api.github.com/", number of workers: 2, 1500 reqs / 1h0m0s (interval: 2.4s)"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] github graphql init success with remaining 4442/5000 and will reset at 2023-05-31 11:51:34 +0000 UTC"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] total step: 29"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] executing subtask collectApiMilestones"
time="2023-05-31 11:36:17" level=info msg=" [pipeline service] [pipeline #3] [task #7] [collectApiMilestones] start api collection"
time="2023-05-31 11:36:20" level=info msg
@visortelle
visortelle / gist:93919b76f31896af7bb676b96669de6a
Created July 10, 2022 09:19
List all pods security context in current namespace
kubectl get pods --all-namespaces -o go-template --template='{{range .items}}{{"pod: "}}{{.metadata.name}}
{{if .spec.securityContext}}
PodSecurityContext:
{{"runAsGroup: "}}{{.spec.securityContext.runAsGroup}}
{{"runAsNonRoot: "}}{{.spec.securityContext.runAsNonRoot}}
{{"runAsUser: "}}{{.spec.securityContext.runAsUser}} {{if .spec.securityContext.seLinuxOptions}}
{{"seLinuxOptions: "}}{{.spec.securityContext.seLinuxOptions}} {{end}}
{{else}}PodSecurity Context is not set
{{end}}{{range .spec.containers}}
@visortelle
visortelle / typescriptreact.json
Last active March 11, 2022 17:21
VSCode React snippets
{
"New component": {
"prefix": "rfc",
"body": [
"import React from 'react';\nimport s from './$1.module.css'\n\nexport type $1Props = {};\n\nconst $1: React.FC<$1Props> = (props) => {\n return (\n <div className={s.$1}>$0</div>\n );\n}\n\nexport default $1;"
],
"description": "Create new component"
}
}
@visortelle
visortelle / minimal_ghc_ghcjs_nix.sh
Created February 11, 2022 09:56 — forked from louispan/minimal_ghc_ghcjs_nix.sh
Install Cabal, GHC, or GHCJS with one Nix command
# install nix (5.5 mins)
curl https://nixos.org/nix/install | sh
# open a new shell to source nix
bash
# query available haskell compilers
nix-env -qaP -A nixpkgs.haskell.compiler [QUERY]
# install ghc (2.5 mins, cached binary)
@visortelle
visortelle / _chrome-ext-auth-identity.md
Created November 27, 2021 06:27 — forked from raineorshine/_chrome-ext-auth-identity.md
How to set up user authentication for a Chrome Extension using the Chrome Identity API

How to set up user authentication for a Chrome Extension using the Chrome Identity API

  1. Create a private key file, from which you can create the manifest key and Application ID, as detailed here: https://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console https://console.developers.google.com/project
  4. Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
  5. Copy the Client ID to oauth2.client_id in the manifest.json

Deprecated?

@visortelle
visortelle / gist:f7daf568c0b2602c0ad233692bab4bd7
Created November 11, 2021 07:10
Search programming-related answers in Google excluding useless stuff.
-site:coder.work -site:py4u.net -site:githubmemory.com -site:coderoad.ru -site:titanwolf.org -site:codejzy.com
@visortelle
visortelle / Notes_on_Pair_Programming.md
Created October 25, 2021 20:15
Recommendations, quotes, and links to become better at pair programming