This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, HostListener, signal } from '@angular/core'; | |
@Directive({ | |
selector: '[appTrackFocus]', | |
standalone: true, | |
exportAs: 'isFocused', | |
}) | |
export class TrackFocusDirective { | |
isFocused = signal(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Full instructions | |
# https://blog.entrostat.com/install-byobu-on-any-linux-distro/ | |
BYOBU_VERSION=5.133 | |
set -e | |
echo "Please make sure you have the following dependencies installed:" | |
echo " [+] tar" | |
echo " [+] screen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
name: string; | |
surname: string; | |
email: string; | |
age: number; | |
uuid: string; | |
}; | |
async function confirmSurname(person: Partial<Person>) { | |
if (!person.email) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const name = 'John'; | |
const surname = 'Doe'; | |
const someOtherVariableThatIsNotNamedCorrectly = 22; | |
const person = { name, surname }; | |
const personWithAge = { | |
name, | |
surname, | |
age: someOtherVariableThatIsNotNamedCorrectly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const map = new Map(); | |
map.set(1, 'simple'); | |
console.log(map.get(1)); | |
// 'simple' | |
const person = { | |
name: 'John', | |
surname: 'Doe' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = { | |
character: 'a', | |
description: 'This is a', | |
level: 1, | |
aUnique: 123 | |
}; | |
const b = { | |
description: 'This is b', | |
bbb: 'b' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before the "@config" path | |
import * as config from '../../config'; | |
import { Config } from '../../config'; | |
// After the "@config" path | |
import * as config from '@config'; | |
import { Config } from '@config'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compiler": { | |
"paths": { | |
"@config": ["src/config"], | |
"@logger": ["src/modules/shared/logger/logger.service"], | |
"@modules/*": ["src/modules/*"] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const database = { | |
type: 'postgres', | |
host: process.env.DB_HOST, | |
port: Number(process.env.DB_PORT || 5432), | |
username: process.env.DB_USERNAME, | |
password: process.env.DB_PASSWORD, | |
database: process.env.DB_DATABASE, | |
name: 'default', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Import the full config object | |
import { Config } from '@config'; | |
console.log(Config.database); | |
// 2. Import a single "feature" | |
import { database } from '@config'; | |
// 3. Import the full config but as a namespace | |
import * as config from '@config'; |
NewerOlder