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
// copy-paste to browser console ;) | |
// you MUST have an avatar if you want to use this script! | |
(() => { | |
const topRightUserAvatarSelector = '.Avatar.Avatar--small.TopbarPageHeaderGlobalActions-settingsMenuAvatar' | |
const sortableCardSelector = '.BoardCardWithCustomProperties' | |
const sortableCardAvatarSelector = '.Avatar.Avatar--small.DomainUserAvatar-avatar' | |
const baseImgURL = | |
document.querySelector(topRightUserAvatarSelector) |
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
// this function maps an object into array of objects | |
// and puts object keys into key property of array items | |
const mapObjectToArray = (obj) => ( | |
Object.entries(obj || {}) | |
.map(([key, value]) => ( | |
typeof value === 'object' ? | |
{...value, key} | |
: | |
{key, value} | |
)) |
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
### STAGE 1: Build ### | |
FROM node:12.10.0-alpine as builder | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
COPY public/ public/ | |
COPY src/ src/ | |
RUN npm install |
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 ({ sourceCourseId, targetChapterId }) => { | |
const getContents = async (id) => { | |
const response = await fetch("https://coderoad.thinkific.com/api/v2/courses/" + id, { | |
"body": null, | |
"method": "GET", | |
"mode": "cors", | |
"credentials": "include" | |
}) | |
const data = await response.json() | |
return data.contents |
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
// works only in Firefox and its based on https://firefox-source-docs.mozilla.org/devtools-user/taking_screenshots/index.html | |
// you need to find the wrapper over pages in Canva (they all should have same class) and pass them as an arg to this function | |
// if Canva structure will change you can play with selector in first `.map` | |
const makeScreenshotsOfAllPages = ({ pageWrapperClass }) => ( | |
$$(`.${pageWrapperClass}`) | |
.map((e, i) => `.${pageWrapperClass}:nth-of-type(${i+1}) > div:nth-of-type(2)`) | |
.map((selector, i) => `:screenshot --selector "${selector}" --file --filename "${document.title.replaceAll('/', '')} – ${i + 1}.png"`) | |
.map((command) => { |