Skip to content

Instantly share code, notes, and snippets.

View hungdev's full-sized avatar
💭
I may be slow to respond.

Hung Vu hungdev

💭
I may be slow to respond.
View GitHub Profile
@hungdev
hungdev / download file with fetch.md
Created June 3, 2019 10:11
download file with fetch
fetch(getOurInfo.file_url)
          .then(res => res.blob()).then((blob) => {
            const a = document.createElement('a');
            const url = window.URL.createObjectURL(blob);
            a.href = url;
            a.download = getOurInfo.file_name || 'Sumaten-introduction.pdf';
            a.click();
            window.open(url, '_blank');
@hungdev
hungdev / Listen to page refresh and window close on react-router.md
Created June 3, 2019 09:08
Listen to page refresh and window close on react-router.md
@hungdev
hungdev / aws upload.md
Created May 20, 2019 15:11
aws upload.md
var router = require('express').Router()
const multer = require('multer');
const fs = require("fs");
var path = require('path');
const uuidv4 = require('uuid/v4');
const rootPath = require('../server')
const upload = require('./multerConfig');
const AWS = require('aws-sdk');
objNode.style.width = "100vw";
objNode.style.height = "100vh";
###############################################################################
# SECTION:Initial Settings
###############################################################################
# ConfigServer Firewall & Security Configuration File
#
# Copyright 2006-2013, Way to the Web Limited
# URL: http://www.configserver.com
# Email: [email protected]
###############################################################################
@hungdev
hungdev / deploy with other node.md
Created May 9, 2019 09:49
deploy with other node.md

dung pm2 start index.js

upstream servernode{
   ip_hash;
    server 127.0.0.1:3000;
}
server {
    server_name downloadblog.net;
    client_max_body_size 100M;
@hungdev
hungdev / document style.md
Last active May 5, 2019 07:25
document style
alignContent: ""
alignItems: ""
alignSelf: ""
alignmentBaseline: ""
all: ""
animation: ""
animationDelay: ""
animationDirection: ""
animationDuration: ""
@hungdev
hungdev / remove all node module script.md
Created May 3, 2019 08:35
remove all node module script

sudo find /Users/cee/Desktop -name "node_modules" -exec rm -rf '{}' +

@hungdev
hungdev / node download.md
Last active April 5, 2019 13:27
node download
'use strict'

const Fs = require('fs')  
const Path = require('path')  
const Axios = require('axios')

async function downloadImage () {  
  const url = 'https://unsplash.com/photos/AaEQmoufHLk/download?force=true'
 const path = Path.resolve(__dirname, 'images', 'code.jpg')
@hungdev
hungdev / LC_CTYPE.txt
Created April 1, 2019 16:30 — forked from HJianBo/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8