Skip to content

Instantly share code, notes, and snippets.

View omonk's full-sized avatar
🐕
Woof

Ollie Monk omonk

🐕
Woof
View GitHub Profile

Hi there

@omonk
omonk / linked.js
Last active September 14, 2019 05:10
skrrrrt
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'
@omonk
omonk / node-sass
Last active November 6, 2017 22:23
# 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
{
}
@omonk
omonk / Loop over map
Last active August 29, 2015 14:27
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
/*------------------------------------*\
LOOKBOOK SUB LANDING
Styling here for sub landing page