- disable backups (
backup_retention=0
) - disable multi-AZ and autovacuum
pg_dump -Fc
(compressed) andpg_restore -j
(parallel)- Increase
maintenance_work_mem
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 puppeteer = require('puppeteer'); | |
class Jokes { | |
static async getBestData() { | |
const browser = await this.getBrowser(); | |
const page = (await browser.pages())[0]; | |
await this._definePageConfig(page); |
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 CSV_URL = "https://gist.githubusercontent.com/leonardorifeli/9051a515e14c061247d483906383152e/raw/78f3b0702ade0348aa776d2727eddbe815df8348/spotify-music-classification"; | |
const request = require('request-promise-native').defaults({ | |
resolveWithFullResponse: true | |
}); | |
const csv = require('csvtojson'); | |
class CSVParser { | |
static async parseCSV(url) { |
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
class DateParser { | |
date: Date; | |
constructor(date: string) { | |
try { | |
this.date = new Date(this.format(date)); | |
} catch (e) { | |
throw e; | |
} |
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
package main | |
import ( | |
"log" | |
"encoding/json" | |
"fmt" | |
"os" | |
"math/rand" |
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
// the wizare functions | |
var sendString = (function(rfb, force, sendDelay) { | |
sendDelay = sendDelay || 25; | |
var _q = []; | |
var _qStart = function() { | |
var chr = _q.shift(); | |
if (chr) { | |
rfb.sendKey(chr); | |
setTimeout(_qStart, sendDelay); | |
} |
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
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// For dev purposes only | |
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' }); | |
// Read in the file, convert it to base64, store to S3 | |
fs.readFile('del.txt', function (err, data) { | |
if (err) { throw err; } |
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
#!/bin/bash | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
async function sendAsync(userId) { | |
let user = await getUser(userId); | |
let profile = await getProfile(user); | |
let account = await getAccount(profile); | |
let report = await getReport(account); | |
let send = sendStatistic(report); | |
console.log(send); | |
} |
NewerOlder