LIST

nix hello world (building my own package)

Install nix (https://nixos.org/download.html) sh <(curl -L https://nixos.org/nix/install) --daemon Create a place for the hello world mkdir helloworld cd helloworld touch default.nix nix-prefetch-url https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz # path is '/nix/store/xxx-hello-2.10.tar.gz' # 0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i Edit file ‘helloworld/default.nix' let pkgs = import <nixpkgs> {}; in pkgs.stdenv.mkDerivation { name = "hello-2.10"; src = pkgs.fetchurl { url = "https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"; sha256 = "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"; }; } Build also known as ’nix-build default.nix' nix-build ls -l # -rw-r--r-- 1 xxx xxx 248 dd mmm hh:mm default....

February 18, 2023

micronaut library standalone project

Don’t follow this if you can make a gradle submodule. That is much simpler This is for adding a local project as an instant dependency. a) How to add micronaut library inspired by Modularizing with Micronaut Framework _ kreuzwerker but changing to import a local project instead of using lib/xxx.jar b) How to add a local standalone gradle project inspired by java - Gradle Local Project Dependency - Stack Overflow but change compile project("…") to implement project("…")...

February 14, 2023

AWS rest api gateway custom domain name 403 forbidden

if you’ve set up a custom domain name for api gateway your integration will give you a domain name like xxx.cloudfront.net but if you curl that, it won’t work, returning status=403 curl https://xxx.cloudfront.net > {"message":"Forbidden"} to make that work: curl --header "Host: your.custom.domain.name" https://xxx.cloudfront.net/ which should be the default behaviour if you access curl https://your.custom.domain.name/ but only if you have your CNAME correctly Type Domain Name Canonical Name CNAME your.custom.domain.name xxx....

February 7, 2023

python poetry intellij

brew install pyenv brew install poetry pyenv install 3.9 in intellij, in project settings (1) Create module Project Setting - Modules add a new module - import module (2) Create python interpreter SDK (platform/global/project?) Platform Settings - SDKs + -> python SDK System Interpreter Interpreter = … -> /Users/xxx/.pyenv/versions/3.9.16/bin/python (3) Create module SDK (module) Then in the module - Dependencies Module SDK -> dropdown -> add sdk -> python SDK “Poetry Environment” associated project = YOUR_MODULE (creating the python sdk via Platform SDKs does not give you this option) base interpreter Poetry executable = /usr/local/bin/poetry...

January 30, 2023

Best practice vs sensible default

Ref Dreyfus model Opinion: when you’re craving(aka looking for) “best practices” you’re in the beginner stage Best practices are useful for learning when you’re new to a topic. You’d rather blindly follow something that is more often than not right. Because it’s impossible to start anywhere other than as a beginner. But rephrasing them as “sensible default” surfaces that lack of knowledge, and the risk. It’s expected a beginner will follow sensible default blindly....

January 27, 2023

Gradle dependencies

Dependencies apply to a specific scope eg: compiling source code runtime the scope is represented by a Configuration The java plugins defines inheritance main source set test source set: (src: https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_plugin_and_dependency_management)

January 26, 2023

NGINX: single page application static website (nginx docker)

./nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; server { listen 80; root /usr/share/nginx/html; index index.html; location / { # First attempt to serve request as file, then # as directory, then fall back to redirecting to index.html try_files $uri $uri/ $uri....

September 26, 2022

typescript compile alias cmd for tsc

npm install --save-dev typescript ./.envrc export_alias tsc 'npx tsc'

September 26, 2022

AWS & Typescript Masterclass - 10. Using AWS inside a React project with Amplify

82-93 (82) Section intro introduce AWS Amplify in the browser Get temporary credentials in the Browser CORS issues App will be approaching it’s final form (83) Setup and Amplify install npm i aws-amplify @aws-amplify/auth npm i aws-sdk (84) Cognito login from React code model.ts import {CognitoUser} from '@aws-aplify/auth' export interface User { userName: string cognitoUser: CognitoUser } service/AuthService import {Auth} from "aws-amplify"; import Amplify from "aws-amplify"; import {CognitoUser} from "@aws-amplify/auth"; import {config} from "....

September 17, 2022

AWS & Typescript Masterclass - 15. other courses

Unit Testing for Typescript & NodeJs Developers with Jest https://www.udemy.com/course/unit-testing-typescript-nodejs Advanced Typescript programming with NodeJs and Webpack https://www.udemy.com/course/typescript-full-stack-programming Typescript with React classes - quick start - Jest testing https://www.udemy.com/course/typescript-with-react-jest-testing Mastering Visual Studio Code https://www.udemy.com/course/mastering-visual-studio-code Advanced Java programming with JavaFx: Write an email client https://www.udemy.com/course/advanced-programming-with-javafx-build-an-email-client Ubuntu Linux on VirtualBox quick setup https://www.udemy.com/course/ubuntu-linux-on-virtualbox-quick-setup Git with Visual Studio Code https://www.udemy.com/course/git-with-visual-studio-code

September 17, 2022