This file contains hidden or 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
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); |
This file contains hidden or 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
var fs = require('fs'); | |
var https = require('https'); | |
var express = require('express'); | |
var app = express(); | |
var options = { | |
key: fs.readFileSync('./file.pem'), | |
cert: fs.readFileSync('./file.crt') | |
}; | |
var serverPort = 443; |
This file contains hidden or 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
const util = require('util') | |
const mysql = require('mysql') | |
const pool = mysql.createPool({ | |
connectionLimit: 10, | |
host: 'localhost', | |
user: 'root', | |
password: 'password', | |
database: 'my_database' | |
}) |
This file contains hidden or 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
// If you’ve accidentally checked in node_modules before, that’s okay. You can remove it like this: | |
echo 'node_modules' >> .gitignore | |
git rm -r --cached node_modules | |
git commit -am 'ignore node_modules' | |
// create dump data for mysql | |
// SET PATH FIRST | |
mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql | |
// Use utf8 in CMD Windows |
This file contains hidden or 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
// Pseudo Jquery | |
const $ = document.querySelector.bind(document); | |
const $$ = document.querySelectorAll.bind(document); | |
// convert a number in decimal to binary | |
8..toString('2') // '1000' |
This file contains hidden or 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
using System; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace HttpListenerExample | |
{ | |
class Program | |
{ | |
public static HttpListener listener; |
This file contains hidden or 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
style> | |
.heart { | |
position: absolute; | |
margin: auto; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
background-color: pink; | |
height: 50px; |
NewerOlder