Skip to content

Instantly share code, notes, and snippets.

@wolfpilot
wolfpilot / findOverflowParents.js
Created June 15, 2023 10:43 — forked from brandonjp/findOverflowParents.js
find overflow:hidden ancestors
// when you're trying to use `position:sticky` on an element
// you'll have trouble if any parent/ancestor element has
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll)
// & turns out if a parent is `display:flex` it might need some love
// (to remedy this you can set the `align-self` of your sticky element)
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o
// so, to find those troublesome parents...
// copy & paste this into Chrome Inspector/Dev Tools console
// (and be sure to change the #stickyElement below, if needed)
@wolfpilot
wolfpilot / get_prismicio_schema.js
Created November 25, 2020 11:09 — forked from nanorepublica/get_prismicio_schema.js
Quick script to get a GraphQL schema file for Content Models from Prismic.io graphql endpoint.
const { buildClientSchema, printSchema } = require("graphql");
const fs = require("fs");
const { PrismicLink } = require('apollo-link-prismic');
const { gql, ApolloClient, InMemoryCache } = require("apollo-boost");
const prismicReposistory = "<prismic.io repository name>"
const accessToken = "<access token from the repo API settings page"
const ouputFile = "./prismic.graphql"
@wolfpilot
wolfpilot / pr.md
Created March 1, 2019 16:17 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: