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
multer = require('multer'); | |
var storage = multer.diskStorage({ | |
destination: function (req, file, cb) { | |
cb(null, 'public/uploads/images/') | |
} | |
}); | |
var upload = multer({ storage: storage }); | |
module.exports = function (app) { |
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
props: ['initialCounter'], | |
data: function () { | |
return { | |
counter: this.initialCounter | |
} | |
} |
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 { NestMiddleware } from '@nestjs/common'; | |
import { Request, Response, NextFunction } from 'express'; | |
import axios, { AxiosRequestConfig } from 'axios'; | |
export class ReverseProxyMiddleware implements NestMiddleware { | |
after(str, substr): string { | |
return str.slice(str.indexOf(substr) + substr.length, str.length); | |
} | |
use(req: Request, res: Response, next: NextFunction) { | |
if (process.env.NODE_ENV != 'dev' || !process.env.PROXY) { |
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
// EmptyBucket will empty a s4bucket. | |
func EmptyBucket(bucket string, s3Aws *s3.S3) error { | |
params := &s3.ListObjectsInput{ | |
Bucket: aws.String(bucket), | |
} | |
for { | |
//Requesting for batch of objects from s3 bucket | |
objects, err := s3Aws.ListObjects(params) | |
if err != nil { |
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
body { | |
white-space: pre; | |
font-family: 'Source Code Pro', monospace; | |
color: white; | |
background: #282C34; | |
} | |
.property { | |
color: #DB6A73; | |
font-weight: bold; |
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
alias glist="git for-each-ref --count=20 --sort=-committerdate refs/heads/ --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'" |