Skip to content

Instantly share code, notes, and snippets.

View btd1337's full-sized avatar

Helder Reis btd1337

  • Juiz de Fora
View GitHub Profile
@markpenaranda
markpenaranda / restful-crud-role.guard.ts
Last active December 9, 2020 01:17
NestJSX CRUD - restful role guard
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'
import { getAction } from '@nestjsx/crud'
@Injectable()
export class RestfulCrudRoleGuard implements CanActivate {
constructor(
// private readonly reflector: Reflector,
public restfulCrudOptions: {
readAllRoles: string [],
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@scokmen
scokmen / HttpStatusCode.ts
Created April 25, 2017 11:10
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@mikedidthis
mikedidthis / _typography.scss
Created February 7, 2014 12:30
A More Modern Scale for Web Typography - With REMS
// Modern Scale for Web Typography
// Ref: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// -----------------------------------------------------------------------------
// Mobile
// -----------------------------------------------------------------------------
// Elem | Font | Line
// -----------------------------------------------------------------------------
// Body | 16px | 20px
// h1 | 32px | 40px
// h2 | 26px | 30px