-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
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); |
In your command-line run the following commands:
brew doctor
brew update
[ | |
{"group":"US (Common)", | |
"zones":[ | |
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"}, | |
{"value":"America/New_York","name":"New York (Eastern)"}, | |
{"value":"America/Chicago","name":"Chicago (Central)"}, | |
{"value":"America/Denver","name":"Denver (Mountain)"}, | |
{"value":"America/Phoenix","name":"Phoenix (MST)"}, | |
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"}, | |
{"value":"America/Anchorage","name":"Anchorage (Alaska)"}, |
function camel(object) {
const keys = Object.keys(object);
return keys.reduce((o, k) => {
if (k.includes('_')) {
const words = k.split('_');
const capitalized = words.map((word, i) => {
if (word.length > 0) {
const capital = i > 0 ? `${word[0].toUpperCase()}${word.substr(1)}` : word;
return capital;
function* iterate(length) {
for (let i = 1; i <= length; i += 1) yield i;
}
function* pow2(array) {
for (let i in array) yield array[i] ** 2;
}
const res = [...pow2([...iterate(10)])]; // (10) [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
function createPromises(length) {
const promises = [];
for (let i = 0; i < length; i += 1) {
const value = Math.random();
promises.push(new Promise((resolve, reject) => setTimeout(() => {
if (value < 0.1) reject('exception');
resolve(value);
}, value * 1000)));
}
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
{
"Africa/Abidjan": 0,
"Africa/Accra": 0,
"Africa/Addis_Ababa": -180,
"Africa/Algiers": -60,
"Africa/Asmara": -180,
"Africa/Asmera": -180,
"Africa/Bamako": 0,
"Africa/Bangui": -60,
module.exports = { | |
up: function (queryInterface, Sequelize) { | |
return [ | |
queryInterface.addColumn('User', 'name', { | |
type: Sequelize.STRING | |
}), | |
queryInterface.addColumn('User', 'nickname', { | |
type: Sequelize.STRING, | |
}) | |
]; |