Skip to content

Instantly share code, notes, and snippets.

View resistdesign's full-sized avatar
💭
Exploring bypassed terrain.

Ryanne Graff resistdesign

💭
Exploring bypassed terrain.
View GitHub Profile
@lmakarov
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@DrPaulBrewer
DrPaulBrewer / UploaderForGoogleDrive.js
Last active December 17, 2022 09:49
Upload Browser Blobs to Files in Google Drive API v3
// upload.js, from https://github.com/googledrive/cors-upload-sample
// Contributors Steve Bazyl, Mike Procopio, Jeffrey Posnick, Renaud Sauvain
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0
//
// Implements Resumable Upload for Google Drive as described by
// https://developers.google.com/drive/v3/web/resumable-upload
//
// Modified by Paul Brewer, Economic and Financial Technology Consulting LLC
// Nov. 1 2017
// 1. use Google Drive API V3 instead of V2
@ceving
ceving / ancestors.js
Last active May 29, 2023 05:05
JavaScript ancestor class list
/**
* Returns the list of ancestor classes.
*
* Example:
* ancestors(HTMLElement) .map (e => e.name || e.constructor.name)
* => [ "HTMLElement", "Element", "Node", "EventTarget", "Function", "Object" ]
*/
function ancestors (anyclass)
{
switch (true) {