Skip to content

Instantly share code, notes, and snippets.

@ktsangop
ktsangop / nginx-php-windows-setup.md
Created March 12, 2025 07:57 — forked from odan/nginx-php-windows-setup.md
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

@ktsangop
ktsangop / myAngular.html
Created November 2, 2024 09:09 — forked from faustinoaq/myAngular.html
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@ktsangop
ktsangop / discord_qa.md
Created August 29, 2023 15:11
Merge multiple Angular SPAs to a monorepo(?) under a host application

Hello people.

We are trying to create a kind of portal which will serve as a host to multiple (3 at the moment) separate Angular SPAs, with the intention to be extendable (add more apps or "modules" in the future).

The current 3 web apps are in separate repos, and mostly have the same dependencies. They use the same ui framework but have different styling.

Our requirement is to somehow make those 3 work under another host application which will handle :

  1. Authentication (both apps use the same auth service and users will sign in once and access resources using JWT tokens)
  2. Navigation/Routing (the host app will be responsible for switching through the web apps and navigating some of the app routes)
  3. Provide global styles that will be inherited by the other apps
@ktsangop
ktsangop / assets.js
Created April 6, 2023 06:46
MFE - Resolve static assets (images)
resolve() {
if (!environment.production) {
this.element.nativeElement.style.backgroundImage = `url("./assets/somefile.svg")`;
return;
}
this.element.nativeElement.style.backgroundImage = `url('https://your.mfe.host/assets/somefile.svg')`;
}
@ktsangop
ktsangop / crypto-aes-gcm.js
Created January 18, 2023 08:50 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@ktsangop
ktsangop / .eslintrc.js
Created December 12, 2022 08:37 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@ktsangop
ktsangop / tooltip directive test
Created December 4, 2018 18:59
Testing directives (An example from angular/material repo)
Use this file as an example of how to unit test directives :
https://github.com/angular/material2/blob/master/src/lib/tooltip/tooltip.spec.ts