Skip to content

Instantly share code, notes, and snippets.

View MisterPea's full-sized avatar
:octocat:
Occasionally epistemically ambivalent

Perry Angelora MisterPea

:octocat:
Occasionally epistemically ambivalent
View GitHub Profile
@MisterPea
MisterPea / s3ErrorCodes.js
Created February 25, 2024 16:50
AWS S3 Error Codes
const s3ErrorCodes = {
AccessControlListNotSupported: {
description: 'The bucket does not allow ACLs.',
httpStatusCode: '400 Bad Request'
},
AccessDenied: { description: 'Access Denied', httpStatusCode: '403 Forbidden' },
AccessPointAlreadyOwnedByYou: {
description: 'An access point with an identical name already exists in your account.',
httpStatusCode: '409 Conflict'
},
// The classic AJAX call - dispatch before the request, and after it comes back
function myThunkActionCreator(someValue) {
return (dispatch, getState) => {
dispatch({type : "REQUEST_STARTED"});
myAjaxLib.post("/someEndpoint", {data : someValue})
.then(
response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}),
error => dispatch({type : "REQUEST_FAILED", error : error})
);
@MisterPea
MisterPea / Query.js
Created June 28, 2020 23:22
mongoose-fuzzy-output
Query {
_mongooseOptions: {},
_transforms: [],
_hooks: Kareem { _pres: Map(0) {}, _posts: Map(0) {} },
_executionCount: 0,
mongooseCollection: NativeCollection {
collection: null,
Promise: [Function: Promise],
_closed: false,
opts: {