I hereby claim:
- I am omonk on github.
- I am olliemonk (https://keybase.io/olliemonk) on keybase.
- I have a public key ASAq3BXUM_gQpE-KpsiVB0XvB2XcZ-1eI23vpHBFOOsCwgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| function solution(A) { | |
| const { total } = A.reduce( | |
| ({ position, total }, _, _idx, arr) => { | |
| const val = arr[position]; | |
| if (val !== -1) { | |
| return { | |
| position: arr[position], | |
| total: total + 1, | |
| }; |
| /* | |
| This script serves the purpose of fetching blog posts data from medium and upload it to contentful so it can be used on pages like blog, speciality, etc without being dependant of gatsby-source-medium. | |
| Before running the script: | |
| 1. manually copy the content from https://medium.com/${nameOfBlog}/latest?format=json&limit=100 | |
| 2. paste it and save in a file named "json-file.json" in this directory | |
| 3. strip the begining of the content until the respose object begins: `])}while(1);</x>` | |
| 4. make sure you have CMS_CRUD and CONTENTFUL_SPACE defined on your .env file | |
| */ |
| import React from 'react' | |
| import styled from 'styled-components' | |
| import breakpoint from 'styled-components-breakpoint' | |
| import ReactMarkdown from 'react-markdown' | |
| import StyledLink from './StyledLink' | |
| import GreyBackground from './GreyBackground' | |
| import { Row, Col, Grid } from '../grid' | |
| import { DisplayTitle } from '../Typography' |
| # file structure | |
| // This is what we set up | |
| src/ | |
| scss/ | |
| styles.scss // all your @imports | |
| _global.scss // global stuff in here | |
| _header.scss // header specific | |
| _main.scss // page specific | |
| ...etc, imported files should have `_` in front of them |
| gist |
| // app.js | |
| var dimensions = require('./routes/dimensions'); | |
| app.use('/:width/:height', dimensions); | |
| // .routes/dimensions.js | |
| var express = require('express'); | |
| var router = express.Router(); | |
| router.get('/:width/:height', function(req, res, next) { |
| atom-sync-2 |
| { | |
| } |