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 stop kong-database | |
docker rm kong-database | |
docker stop kong | |
docker rm kong | |
--------------------- | |
docker run -d --name kong-database ^ | |
-p 5432:5432 ^ | |
-e "POSTGRES_USER=kong" ^ |
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
version: '2' | |
services: | |
mongodb: | |
image: bitnami/mongodb:latest | |
container_name: newsurvey-mongodb | |
environment: | |
- MONGODB_USERNAME=admin | |
- MONGODB_PASSWORD=admin1234 | |
- MONGODB_DATABASE=newsurvey | |
ports: |
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
version: '2' | |
services: | |
mongodb: | |
image: mongo:3 | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.6.1 | |
environment: | |
- http.host=0.0.0.0 | |
- transport.host=localhost | |
- network.host=0.0.0.0 |
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 config = require('../../config') | |
const AWS = require('aws-sdk') | |
const zlib = require('zlib') | |
const Duplex = require('stream').Duplex | |
const s3 = new AWS.S3({ | |
credentials: { | |
accessKeyId: config.aws.accessKey, | |
secretAccessKey: config.aws.secretKey | |
} | |
}) |
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
[...Array(10000).keys()].map(a => (a+1).toString()).join('').match(/0/g).length |
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
create table m_data_1 as (select * from m_data); | |
create table m_data_2 as (select * from m_data) with no data; |
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 onClick = (e: MouseEvent) => { | |
e.stopPropagation(); | |
// ... | |
}; |
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
select | |
date_trunc('minute', created_at), -- or hour, day, week, month, year | |
count(1) | |
from users | |
group by 1; |
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
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'db-name-1' | |
AND pid <> pg_backend_pid(); | |
CREATE DATABASE "db-name-2" | |
WITH TEMPLATE "db-name-1" | |
OWNER produsr; |
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
du -d 1 -h node_modules/ | grep prisma |
OlderNewer