Deploy a Express.js project on Heroku
Step by step from command line by Steve Tuan
const PORT = process.env.PORT || 3000
app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`))
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
{ | |
"extends": ["react-app", "plugin:prettier/recommended"] | |
} |
<html> | |
<body> | |
<form action="/upload" enctype="multipart/form-data" method="post"> | |
<input type="text" name="title"> | |
<input type="file" name="file"> | |
<input type="submit" value="Upload"> | |
</form> | |
</body> | |
</html> |
Step by step from command line by Steve Tuan
const PORT = process.env.PORT || 3000
app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`))
/* | |
C++ Program to check for balanced parentheses in an expression using stack. | |
Given an expression as string comprising of opening and closing characters | |
of parentheses - (), curly braces - {} and square brackets - [], we need to | |
check whether symbols are balanced or not. | |
*/ | |
#include<iostream> | |
#include<stack> | |
#include<string> | |
using namespace std; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
A Pen by Hoang Minh Tuan on CodePen.
A Pen by Hoang Minh Tuan on CodePen.