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
import * as AWS from "aws-sdk" | |
import { chunk } from "lodash" | |
import awsConfig from "config/aws" | |
const S3 = new AWS.S3(awsConfig.S3) | |
async function upload(params) { | |
const { Body, ACL, Bucket, Key, ContentType } = params | |
const createMultipartUpload = { | |
ACL, |
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 request = require('request') | |
const cors = require('cors') | |
const express = require('express') | |
const app = express() | |
app.use(cors()) | |
app.get('/oauth/login', login) | |
app.get('/oauth/callback', callback) | |
app.listen(3333) |
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
import axios from 'axios' | |
const CONCURRENT_UPLOADS = 6 | |
// Time between verifications to know if there's | |
// a space on the queue to make a new request | |
const INTERVAL_MS = 10 | |
let PENDING_UPLOADS = 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
// Usually the file you use to start your application | |
// ... | |
import "module-alias/register" | |
import "tsconfig-paths/register" | |
// ... |
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
echo "Command to make a dump of postgres database" | |
pg_dump -v -h DB_HOST -U DB_USER -d DB_NAME > DUMP_FILE.sql |
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
/* | |
Service to make async process of any payload array, with concurrency support. | |
Author: Guilherme Mota Bromonschenkel Lima | |
Github: guilhermebkel | |
*/ | |
// Milliseconds between checks to look for some available spot on the queue. | |
const REFRESH_TIME = 100; |
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
TypeScript 25 hrs 24 mins ████████████████▋░░░░ 79.7% | |
JavaScript 2 hrs 45 mins █▊░░░░░░░░░░░░░░░░░░░ 8.7% | |
Docker 1 hr 28 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.6% | |
Markdown 36 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9% | |
Other 36 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9% |
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
/* | |
-> Supposing there's a table called 'sel_collections' and a column 'info' with the following format: | |
{ "total_pictures": 2, "total_size": 100 } | |
-> After making the command below, the value inside this column will be: | |
{ "total_pictures": 3, "total_size": 100 } | |
*/ | |
UPDATE | |
sel_collections |
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 -hsc * |
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
free -h && sudo sysctl -w vm.drop_caches=3 && sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -h |
OlderNewer