Skip to content

Instantly share code, notes, and snippets.

@Arp-G
Arp-G / multipart_s3_upload.js
Created June 18, 2022 08:38
Multipart upload to S3
import fs from 'fs';
import { Buffer } from 'node:buffer';
import {
S3Client,
CreateMultipartUploadCommand,
UploadPartCommand,
CompleteMultipartUploadCommand
} from '@aws-sdk/client-s3';
// 100 MB chunk/part size
@gzimbron
gzimbron / gist:ea349ef94bbfe9eadaa4f3939e54779d
Last active April 19, 2022 01:22
Migrate Amplify Project to other AWS Account
1.- Delete amplify/team-provider-info.json, src/aws-exports.js
(optional) run amplify configure to setup new aws profile
2.- run amplify init
import { build, files, version } from '$service-worker';
// https://github.com/microsoft/TypeScript/issues/11781 - this is needed for TS and ESLint
/// env serviceworker
const globalThis = /** @type {unknown} */ (self);
/// <reference no-default-lib="true"/>
/// <reference lib="es2020" />
/// <reference lib="WebWorker" />
const sw = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (globalThis);
@dotspencer
dotspencer / multiple-keys-gitlab.md
Last active March 7, 2024 15:01
Multiple Gitlab accounts with multiple ssh keys

Gitlab won't allow reuse of a public ssh key for multiple accounts. To get around this you need to create a second ssh key for the second account.

Create or modify your ~/.ssh/config file:

# normal                                                                                                                                                                  
Host gitlab.com-work_username
     HostName gitlab.com
     PreferredAuthentications publickey
 IdentityFile ~/.ssh/id_rsa
@pickletoni
pickletoni / countryPhoneCodes.json
Last active April 10, 2024 19:40 — forked from AdonaiAraya/countryPhoneCodes.json
JSON array of 248 countries with phone codes and ISO country code
[{"country":"Afghanistan","code":"93","iso":"AF"},
{"country":"Albania","code":"355","iso":"AL"},
{"country":"Algeria","code":"213","iso":"DZ"},
{"country":"American Samoa","code":"1-684","iso":"AS"},
{"country":"Andorra","code":"376","iso":"AD"},
{"country":"Angola","code":"244","iso":"AO"},
{"country":"Anguilla","code":"1-264","iso":"AI"},
{"country":"Antarctica","code":"672","iso":"AQ"},
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"},
{"country":"Argentina","code":"54","iso":"AR"},