Skip to content

Instantly share code, notes, and snippets.

View maitrungduc1410's full-sized avatar
💪
Keep chasing your dreams!

Duc Trung Mai maitrungduc1410

💪
Keep chasing your dreams!
View GitHub Profile
@maitrungduc1410
maitrungduc1410 / nginx.conf
Created March 28, 2019 07:31
Nginx default configuration file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@maitrungduc1410
maitrungduc1410 / nginx.conf
Last active May 30, 2019 03:19
Nginx setup for Nodejs
server {
listen 80;
listen [::]:80;
server_name _; # change this to your domain name
# 2 lines of code below to hide your server info. You have to install nginx-extras to enable it
# on Ubuntu run: sudo apt-get install nginx-extras
more_clear_headers Server;
server_tokens off;
@maitrungduc1410
maitrungduc1410 / .env
Last active March 27, 2019 09:24
Sg-decoding-ONLINE
MONGO_ROOT_USERNAME=root
MONGO_ROOT_PASSWORD=ce2pFD2jJNmqNJkG
MONGO_HOST=localhost
MONGO_PORT=27017
APP_MONGO_DB=sg-decoding-online
APP_MONGO_USER=user
APP_MONGO_PASS=ZfQDwQYN4T6PQARY
@maitrungduc1410
maitrungduc1410 / .env
Last active March 14, 2019 08:55
SG_DECODING_WEBSITE
MONGO_ROOT_USERNAME=root
MONGO_ROOT_PASSWORD=ce2pFD2jJNmqNJkG
MONGO_HOST=localhost
MONGO_PORT=27017
APP_MONGO_DB=sg-decoding
APP_MONGO_USER=user
APP_MONGO_PASS=ZfQDwQYN4T6PQARY
@maitrungduc1410
maitrungduc1410 / resize.js
Created October 31, 2018 07:51
Resize image to squared image from input file before send server
var tmppath = URL.createObjectURL(file) // create temporary path of file
var img = new Image()
var offset = 0
let self = this
img.onload = function() {
if(this.width < this.height) {
offset = this.width
}
else {
offset = this.height
@maitrungduc1410
maitrungduc1410 / ChatItem.vue
Last active October 28, 2023 08:20
ChatLayout and ChatItem, chat.blade.php
<template>
<div class="message">
<div class="message-item user-name">
MTD
</div>
<div class="message-item timestamp">
| 11:21:32:
</div>
<div class="message-item text-message">
Hello how are you