Skip to content

Instantly share code, notes, and snippets.

View ovistoica's full-sized avatar
🏗️
Building cool stuff

Stoica George-Ovidiu ovistoica

🏗️
Building cool stuff
View GitHub Profile
@ovistoica
ovistoica / @tanstack+query-core+5.40.0.patch
Created June 7, 2024 07:19
Patch for @tanstack/query-core to work correctly with ClojureScript and Google Closure compiler
diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs
index 7e872d0..930e91d 100644
--- a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs
+++ b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs
@@ -4,91 +4,98 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });

Good UI Practices

First let's look at the demo of restructuring Users Management to use RTK query and redux toolkit slices and listeners

Redux

Do's

@ovistoica
ovistoica / VelocityWebstormDefinition.md
Created January 15, 2022 08:13
Create custom Velocity .vtl file association for Webstorm/IntelliJ

image

  1. Press ⌘ , to open the IDE settings and select Editor | File Types.

  2. In the Recognized File Types list, select Files opened in associated applications.

  3. In the File name patterns section on the right, click the Add button and specify a filename pattern (*.vtl) that should be associated with an external application.

Settings

image

@ovistoica
ovistoica / _aws.graphql
Last active December 8, 2021 12:56
AWS Appsync scalars and directives type definitons
# These are here to help the IDE recognise AWS types.
#
# Place this file outside the 'schema' directory so are not pushed to AWS,
# but are still picked up by PhpStorm's GraphQL plugin to help
# validate schemas.
#
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html
#
scalar AWSDateTime
scalar AWSDate

ClojureScript REPL Workflow

Short write up on using REPL when developing UIs in ClojureScript.

Hot-reload on save or Eval in REPL?

Everyone's standard approach to hot-reloading is to use a tool (Figwheel or shadow-cljs) that reloads changed namespaces automatically. This works really well: you change the code, the tool picks up changed files, compiles namespaces and dependants, notifies REPL client which then pulls in compiled changes, and re-runs a function that re-renders UI.

The other approach is to use ClojureScript's REPL directly and rely only on eval from the editor. This more or less matches Clojure style workflow. This approach might be useful when you don't want tools overhead or hot-reloading becomes slow for you or you just used to this style of interactions. Also changing code doesn't always mean that you want to reload all the changes. On the other hand it is very easy to change a couple of top-level forms and forget to eval one of them.

@ovistoica
ovistoica / node_nginx_ssl.md
Created October 30, 2020 10:11 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user