// example
app.set('view options', { root: join(rootDir, 'views') });
View debloat-xiaomi
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
# ./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 |
View debloat-samsung
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
# ./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 |
View ResourceState.kt
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
/** | |
* 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} |
View ejs-options-in-express.md
View how-to-send-payload-per-platform.ts
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 { 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; |
View html5-template.html
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
<!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"> --> |
View utils-debounce.js
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
/** | |
* 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){ |
View custom-entity-not-found-exception-filter.md
Make NestJs returns 404 when EntityNotFoundError exception is thrown
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