Skip to content

Instantly share code, notes, and snippets.

View laerciobernardo's full-sized avatar
🏠
Working from home

Laércio Bernardo laerciobernardo

🏠
Working from home
  • iUPi Tecnologia
  • Vila Nova de Gaia, Porto
  • 20:42 (UTC +01:00)
  • X @laerciobernardo
View GitHub Profile
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active May 17, 2024 12:40
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@gsusmonzon
gsusmonzon / custom-entity-not-found-exception-filter.md
Last active February 17, 2024 06:04
Make NestJs returns 404 when EntityNotFoundError exception is thrown

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

@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>