This file contains 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
docker run -d \ | |
--name postgres \ | |
-p 5432:5432 \ | |
-e POSTGRES_PASSWORD=password \ | |
-e POSTGRES_USER=postgres \ | |
-e POSTGRES_DB=postgres \ | |
-v postgresql_data=/var/lib/postgresql/data \ | |
postgres |
This file contains 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
sudo -u postgres psql -U postgres -d postgres -c "UPDATE \"user\" SET \"password\" = 'test' WHERE \"name\" = 'admin'" |
This file contains 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 deepFreeze = obj => { | |
Object.keys(obj).forEach(prop => { | |
if (typeof obj[prop] === 'object') deepFreeze(obj[prop]); | |
}); | |
return Object.freeze(obj); | |
}; |
This file contains 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 hrstart = process.hrtime() | |
//some code which takes time | |
const hrend = process.hrtime(hrstart) | |
console.info("Execution time (hr): %ds %dms", hrend[0], hrend[1] / 1000000); |
This file contains 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
// Inherits Prototype | |
util.inherits(Constructor, SuperConstructor) | |
// Inherits Instance | |
Object.assign(new Constructor(), new SuperConstructor()) |
- Download WebStorm for Linux platform: https://www.jetbrains.com/webstorm/download/download-thanks.html?platform=linux
- Extract the archive using
sudo tar xvzf WebStorm-2019.3.3.tar.gz -C /opt
- Rename the folder
sudo mv WebStorm-193.6494.34/ WebStorm
- Start it
cd WebStorm/bin && ./webstorm.sh
- Add shortcut from within WebStorm interface: Open Tools -> Create Desktop Entry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
// Model | |
import { User } from '../models/User.js' | |
// Repository | |
import { UserRepositoryInterface } from '../../../../domain/contracts/repository/UserRepositoryInterface.js' | |
export class UserRepository extends UserRepositoryInterface { | |
async create({ id, auth, name, photo }){ |
This file contains 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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
NewerOlder