// example
app.set('view options', { root: join(rootDir, 'views') });
This file contains hidden or 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
| brew install mergiraf | |
| git config --global rerere.enabled true | |
| # zdiff3 can confuse Mergiraf in some cases. Use diff3 if it behaves badly | |
| git config --global merge.conflictstyle zdiff3 | |
| git config --global merge.mergiraf.name mergiraf | |
| git config --global merge.mergiraf.driver 'mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L' | |
| git config --global merge.mergiraf.recursive binary |
This file contains hidden or 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
| aws ec2 describe-instances --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 | |
| aws ec2 describe-network-interfaces --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 | |
| aws elbv2 describe-load-balancers --query "LoadBalancers[?VpcId=='<vpc-id>']" --region eu-west-3 | |
| aws rds describe-db-instances --query "DBInstances[?DBSubnetGroup.VpcId=='<vpc-id>']" --region eu-west-3 | |
| aws lambda list-functions --query "Functions[?VpcConfig.VpcId=='<vpc-id>']" --region eu-west-3 | |
| aws ec2 describe-vpc-endpoints --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 |
This file contains hidden or 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
| # ./adb shell pm list packages | |
| ./adb shell pm uninstall -k --user 0 com.amazon.appmanager | |
| ./adb shell pm uninstall -k --user 0 com.miui.msa.global | |
| ./adb shell pm uninstall -k --user 0 com.google.android.apps.googleassistant | |
| ./adb shell pm uninstall -k --user 0 com.facebook.appmanager | |
| ./adb shell pm uninstall -k --user 0 com.facebook.system | |
| ./adb shell pm uninstall -k --user 0 com.facebook.services | |
| ./adb shell pm uninstall -k --user 0 com.miui.daemon | |
| ./adb shell pm uninstall -k --user 0 com.miui.videoplayer |
This file contains hidden or 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
| # ./adb shell pm list packages -f | facebook | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.mateagent | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.app.spage | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.app.social | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.app.watchmanagerstub | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.app.tips | |
| ./adb shell pm uninstall -k --user 0 com.microsoft.appmanager | |
| ./adb shell pm uninstall -k --user 0 com.microsoft.skydrive | |
| ./adb shell pm uninstall -k --user 0 com.google.android.googlequicksearchbox | |
| ./adb shell pm uninstall -k --user 0 com.samsung.android.game.gametools |
This file contains hidden or 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
| /** | |
| * A generic class that holds a value with its loading status. | |
| * @param <T> | |
| */ | |
| sealed class ResourceState<out T> { | |
| open val isSuccess get():Boolean {return false} | |
| open val isFailure get():Boolean {return false} | |
| open val isLoading get():Boolean {return false} | |
| open fun getOrNull(): T? {return null} |
This file contains hidden or 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 { IResponseBody as FcmResponse, Message as FcmMessage, Sender as FcmSender } from 'node-gcm'; | |
| class FcmMessage2 extends Message { | |
| private apns: Record<string, unknown>; | |
| private android: Record<string, unknown>; | |
| addApnsData(data: Record<string, unknown>): void { | |
| this.apns = data; | |
| } | |
| addAndroidData(data: Record<string, unknown>): void { | |
| this.android = data; |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <title>Your Website</title> | |
| <meta name="description" content="HTML5 template"> | |
| <meta name="author" content="unknown"> | |
| <!-- <link rel="stylesheet" href="css/styles.css?v=1.0"> --> |
This file contains hidden or 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
| /** | |
| * Debounce utility based on `underscore` debouce, but simpler | |
| * usage: `_debounce(onScrollEvent, 100, true)` | |
| * usually you want atBeginning set to false. | |
| * use atBeginning if you want `func` is called when teh sequence of calls starts, | |
| * instead of waiting until `wait` ms have passed without more calls | |
| */ | |
| window._debounce = window._debounce || function(func, wait, atBeginning) { | |
| var timeout; | |
| if (atBeginning){ |
When using findOrFail() or findOneOrFail() from typeORM, a 500 error is returned if there is no entity (EntityNotFoundError).
To make it returns a 404, use an exception filter as described in https://docs.nestjs.com/exception-filters .
file /src/filters/entity-not-found-exception.filter.ts