Skip to content

Instantly share code, notes, and snippets.

@riccoski
riccoski / ApolloClientQueryPlus.js
Last active March 21, 2019 00:28
A way to add TTL to Apollo Client query
import client from './client'
import gql from 'graphql-tag';
const queryPlus = async (props) => {
const { cacheId: id, ttl = 900000, ...queryProps } = props
if (!id)
throw new Error('cacheId is required')
const fragment = gql`
fragment cacheRef on CacheRef {
@jhurliman
jhurliman / UIViewController+SegueData.m
Last active August 29, 2015 14:07
UIViewController+SegueData.m
//
// UIViewController+SegueData.h
// SegueDataPassing - Helper method for performing a segue and passing data to
// the destination view controller.
//
// Created by John Hurliman on 10/21/14.
// Copyright (c) 2014 John Hurliman. Released under the MIT license.
// http://opensource.org/licenses/MIT
//
@toblerpwn
toblerpwn / CustomCollectionFlowLayout.h
Last active April 5, 2022 22:11
Sticky Headers at the top of a UICollectionView! -- // -- http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i -- // -- still needs work around contentInsets.bottom and oddly-sized footers.
//
// CustomCollectionFlowLayout.h
// evilapples
//
// http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i
//
//
#import <UIKit/UIKit.h>
@evadne
evadne / gist:4544569
Last active August 14, 2023 05:04
Todd Laney’s enhancements to Sticky Headers + UICollectionViewFlowLayout
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//