Skip to content

Instantly share code, notes, and snippets.

View OleksiyRudenko's full-sized avatar
💻
Delivering

Oleksiy Rudenko OleksiyRudenko

💻
Delivering
View GitHub Profile
@OleksiyRudenko
OleksiyRudenko / WSL2-networking.md
Created November 13, 2024 17:52
WSL 2 Networking
+ orudenko (dev) replex $ dolt status
- ERRO[0011] load stats init failure: cannot update manifest: database is read only
  On branch dev
  nothing to commit, working tree clean

+ orudenko (dev) replex $ dolt checkout main
- The current directory is not a valid dolt repository.
  run: dolt init before trying to run this command
@OleksiyRudenko
OleksiyRudenko / Promise-chaining.md
Created October 22, 2022 21:00
Promises chaining
    anArray
        .filter(x => x % 2) // odd only
        .reduce(
            (chain, x) => chain.then(() => networkCall(x)), // network call using an odd
            Promise.resolve()
        )
        .then(() => console.log('all done')) // all calls complete

BAAS

BAAS cloud hosting NodeJS lambdas Auth RDBMS NoSQL CLI
[Supabase][_sb]
[Conduit][_cd]
[Acebase][_ab]
[Vercel][_vc]
[x][_]
@OleksiyRudenko
OleksiyRudenko / PAT for workflows.md
Last active July 27, 2022 16:14
Re-issue IDE OAuth token that allows to push GitHub workflows

IDE

(See recipe for Windows below)

I've literally just come across this problem when trying to use IntelliJ to push to a branch that contains a GitHub Action workflow (YAML file in .github/workflows). I didn't find existing resources on the Internet very helpful, so I hope this will help you fix it too.

TL;DR: Generate a new Personal Access Token with the workflow scope enabled in GitHub and configure your application to use that.

Promise patterns

Promises chaining

anArray
  .reduce(
    (chain, x) => chain.then(() => networkCall(x)),
    Promise.resolve()
 )

Images

Lazy loading

<img src="image.png" loading="lazy" alt="…" width="200" height="200">

Adaptive image set

<picture>
  <source media="(min-width:768px)" srcset="med_flag.jpg">
  <source media="(min-width:495px)" srcset="small_flower.jpg">
  <img src="high_flag.jpg" alt="Flags" style="width:auto;">