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 convertDataToAlgoliaObject = (data) => { | |
| let asin; | |
| let brand; | |
| let categories; | |
| let featured; | |
| let price; | |
| let thumbnail; | |
| data.metafields.forEach((metafield) => { | |
| switch (metafield.key) { |
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
| /* eslint-disable no-console */ | |
| require('dotenv').config({ path: './.env.production' }); | |
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const corser = require('corser'); | |
| const next = require('next'); | |
| const routes = require('./routes'); | |
| const algoliasearch = require('algoliasearch'); | |
| const convertDataToAlgoliaObject = require('./utils/convertDataToAlgoliaObject'); | |
| const fetch = require('isomorphic-fetch'); |
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 fetchPost = slug => fetch(`${API_URL}/post/${slug}`) | |
| .then(res => res.json()) | |
| .then(json => console.log(json)); |
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
| // API endpoint for social links | |
| server.get('/api/social-links', (req, res) => { | |
| const params = { | |
| type: 'social-links', | |
| }; | |
| return bucket.getObjects(params) | |
| .then(objects => res.send(objects)) | |
| .catch(err => res.status(404).json({ |
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
| // API endpoint for site metadata (i.e. title, tag, logo) | |
| server.get('/api/meta', (req, res) => bucket.getObject({ slug: 'header' }) | |
| .then(object => res.send(object)) | |
| .catch(err => res.status(404).json({ | |
| message: 'Error fetching header data', | |
| error: err, | |
| }))); |
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
| /* eslint-disable no-console */ | |
| require('dotenv').config({ path: './.env.production' }); | |
| const express = require('express'); | |
| const next = require('next'); | |
| const routes = require('./routes'); | |
| const Cosmic = require('cosmicjs'); | |
| const port = parseInt(process.env.PORT, 10) || 3000; | |
| const dev = process.env.NODE_ENV !== 'production'; | |
| const app = next({ dev }); |
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
| <h1>Infinite Scroll - Masonry image grid</h1> | |
| <div class="grid are-images-unloaded"> | |
| <div class="grid__col-sizer"></div> | |
| <div class="grid__gutter-sizer"></div> | |
| <div class="grid__item grid__item--height2"></div> | |
| <div class="grid__item grid__item--width2"> | |
| <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg" alt="orange tree" /> | |
| </div> | |
| <div class="grid__item grid__item--height3"></div> |
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
| keytool -exportcert -list -v \ | |
| -alias androiddebugkey -keystore ~/.android/debug.keystore |
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
| 100% — FF | |
| 95% — F2 | |
| 90% — E6 | |
| 85% — D9 | |
| 80% — CC | |
| 75% — BF | |
| 70% — B3 | |
| 65% — A6 | |
| 60% — 99 | |
| 55% — 8C |
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
| gnome-desktop-item-edit --create-new ~/Desktop | |
| # create new desktop launcher | |
| dpkg -L <package name> | |
| # see where a package is installed | |
| chmod 777 <filename> | |
| # change permissions to read, write, execute | |
| chmod -R <permissionsettings> <dirname> |