Skip to content

Instantly share code, notes, and snippets.

View ErtugrulBEKTIK's full-sized avatar

Ertuğrul BEKTİK ErtugrulBEKTIK

  • İstanbul
View GitHub Profile
@robertgonzales
robertgonzales / App.jsx
Last active March 26, 2020 15:57
How to make a custom Prompt (using getUserConfirmation) for React Router v4
// use Prompt like normal... magic happens in getUserConfirmation
class App extends Component {
render () {
return (
<Router getUserConfirmation={getUserConfirmation}>
{...}
<Prompt
when={formIsHalfFilledOut}
message="Are you sure you want to leave?"
/>
@twolfson
twolfson / README.md
Last active July 28, 2021 22:52
Quick and dirty database dump to S3 via Node.js

We are implementing database dumping which is straightforward but can be tedious to setup. Here's our setup:

  1. Create AWS user for db backups (e.g. db-backups-{{app}})
    • Save credentials in a secure location
    • If adding db scrubbing, use a separate user (e.g db-scrubs-{{app}})
  2. Create bucket for S3 access logging (e.g. s3-access-log-{{app}})
  3. Create consistently named bucket for db dumps (e.g. db-backups-{{app}})
    • Enable logging to s3-access-log-{{app}} with prefix of db-backups-{{app}}
  4. Add IAM policy for bucket access
  • Select user -> Choose "Add inline policy"