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
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 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 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 | |
*/ |
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
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' |
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
# 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 |
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
gist |
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
// 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) { |
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
atom-sync-2 |
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 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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
/*------------------------------------*\ | |
LOOKBOOK SUB LANDING | |
Styling here for sub landing page |