See how a minor change to your commit message style can make a difference. Examples
Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs
See how a minor change to your commit message style can make a difference. Examples
Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs
| #nginx config file for Nextjs App | |
| #place in /etc/nginx/sites-available/name_of_config_file | |
| server { | |
| listen 80; | |
| server_name domainname.com; | |
| gzip on; | |
| gzip_proxied any; | |
| gzip_types application/javascript application/x-javascript text/css text/javascript; | |
| gzip_comp_level 5; |
| <ng-container *ngIf=" | |
| { | |
| obs1: obs1$ | async, | |
| obs2: obs2$ | async, | |
| obs3: obs3$ | async | |
| } as observables"> | |
| <!-- already expanded observable!--> | |
| {{observables.obs1}} | |
| </ng-container> |
| function myclean { | |
| ## Show free space | |
| df -Th | grep -v fs | |
| # Will need English output for processing | |
| LANG=en_GB.UTF-8 | |
| ## Clean apt cache | |
| apt-get update | |
| apt-get -f install | |
| apt-get -y autoremove |
| type GenericFunction<TS extends any[], R> = (...args: TS) => R; | |
| type Promisify<P> = { | |
| [K in keyof P]: P[K] extends GenericFunction<infer TS, infer R> ? (...args: TS) => Promise<R> : P[K] | |
| }; | |
| // example | |
| sudo powermetrics --samplers smc |grep -i "CPU die temperature" |
| class Animal { | |
| name: string | null; | |
| constructor() { | |
| this.name = null; | |
| } | |
| } | |
| class Bee extends Animal { |
| enum LogLevel { | |
| ERROR, WARN, INFO, DEBUG | |
| } | |
| /** | |
| * This is equivalent to: | |
| * type LogLevelStrings = 'ERROR' | 'WARN' | 'INFO' | 'DEBUG'; | |
| */ | |
| type LogLevelStrings = keyof typeof LogLevel; |
| function curry(fn) { | |
| return function curried() { | |
| return arguments.length >= fn.length | |
| ? fn.apply(null, arguments) // if there are all args - execute fn with them | |
| : curried.bind(null, ...arguments) // return new version of curried() with prepended arg(s) | |
| } | |
| } | |
| curry((x, y, z) => x + y + z)(5)(4)(1); // 10 |
| import * as React from 'react' | |
| type ResultBox<T> = { v: T } | |
| export default function useConstant<T>(fn: () => T): T { | |
| const ref = React.useRef<ResultBox<T>>() | |
| if (!ref.current) { | |
| ref.current = { v: fn() } | |
| } |