Skip to content

Instantly share code, notes, and snippets.

@rmosolgo
rmosolgo / page_example.rb
Created April 10, 2019 14:07
Generic page number / per-page pagination with GraphQL-Ruby
# This is a full-blown offset-based pagination system modelled after GraphQL-Ruby's
# built-in connections. It has a few different elements:
#
# - `::Page`, a plain ol' Ruby class for modeling _pages_ of things.
# This class handles applying pagination arguments to lists (Arrays and AR::Relations)
# and provides metadata about pagination. (Similar to `will_paginate`.)
# - `Schema::BasePage` is a generic GraphQL-Ruby object type. It's never used directly,
# but it can generate subclasses which wrap _specific_ object types in the schema.
# - `Schema::BaseObject.page_type` is a convenience method for generating page types
# from your object types. You could leave this out and make subclasses with plain ol'
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active June 28, 2024 20:49
React Native Bridging Cheatsheet
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#