This file contains hidden or 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
| // please check https://docs.netlify.com/configure-builds/environment-variables/#declare-variables for most up to date info | |
| // this was created before those docs existed | |
| process.env = { | |
| /** | |
| * | |
| * AUTOMATICALLY SET BY NETLIFY. IMMUTABLE! | |
| * docs: https://www.netlify.com/docs/continuous-deployment/#environment-variables | |
| * | |
| */ |
This file contains hidden or 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
| const createAndPublishAssets = (assets, managementToken, spaceId, locale, simpleLog = console.log) => new Promise(async resolve => { | |
| simpleLog('Creating Contentful client') | |
| const client = contentful.createClient({ | |
| accessToken: managementToken, | |
| logHandler: (level, data) => simpleLog(`${level} | ${data}`) | |
| }) | |
| const iterableAssets = makeIterator(assets) | |
| const space = await client.getSpace(spaceId) | |
| const cmsAssets = [] |
This file contains hidden or 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 gist is for Javascript beginners. | |
| * @author: Anthony Du Pont <antho.dpnt@gmail.com> | |
| * @site: https://www.twitter.com/JsGists | |
| * | |
| * You can do really cool effects with Canvas and I am going to show you how to use a video to mask | |
| * and image with it. To be honest I am not really sure this gist is really for beginners but I really | |
| * wanted to do it. So if you are not comfortable with the code below, take a minute, breathe and maybe | |
| * start by reading the basics of Canvas. You will quickly start to notice this gist is not so difficult | |
| * to understand. |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.