Skip to content

Instantly share code, notes, and snippets.

View cloverink's full-sized avatar
🍀
Error Driven Development

Aran Chananar cloverink

🍀
Error Driven Development
View GitHub Profile
@cloverink
cloverink / test.js
Created July 5, 2022 07:52
stopPropagation()
const onClick = (e: MouseEvent) => {
e.stopPropagation();
// ...
};
@cloverink
cloverink / script.sql
Last active March 27, 2023 09:56
How to Duplicate a Table in PostgreSQL
create table m_data_1 as (select * from m_data);
create table m_data_2 as (select * from m_data) with no data;
@cloverink
cloverink / test.js
Created April 1, 2022 08:37
find zero from between number [ 1 ... 10000 ]
[...Array(10000).keys()].map(a => (a+1).toString()).join('').match(/0/g).length
@cloverink
cloverink / gist:b4782e5e99dfb86b53d1e200fe68e8f9
Created January 14, 2022 04:21
S3 Upload /w gzip from stream
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
}
})
@cloverink
cloverink / docker-compose-graylog
Created December 5, 2021 19:58
example docker compose graylog
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
version: '2'
services:
mongodb:
image: bitnami/mongodb:latest
container_name: newsurvey-mongodb
environment:
- MONGODB_USERNAME=admin
- MONGODB_PASSWORD=admin1234
- MONGODB_DATABASE=newsurvey
ports:
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" ^