Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Hudkins nickhudkins

View GitHub Profile
@nickhudkins
nickhudkins / Fetchers.scala
Created Dec 18, 2020
Relationship Fetchers
View Fetchers.scala
import sangria.execution.deferred.{Fetcher, HasId, Relation, RelationIds, SimpleRelation}
object Fetchers {
/*
The following three methods are intended to be representative
of whatever your DAO may provide.
*/
def recipesForUsers(ids: Seq[Id[User]]): Future[Seq[Recipe]] = Future {
Recipe(id = 3, foodId = 2, userId = 3) :: Nil
}
View appium.rb
cask 'appium' do
version '1.10.0'
sha256 '62257dc78097c399fb9a823f649655f4022f400b'
# github.com/appium/appium-desktop was verified as official when first introduced to the cask.
url "https://github.com/appium/appium-desktop/releases/download/v#{version}/Appium-#{version}.dmg"
appcast 'https://github.com/appium/appium-desktop/releases.atom'
name 'Appium Desktop'
homepage 'https://appium.io/'
@nickhudkins
nickhudkins / createFragmentContainer.js
Last active May 12, 2020
Data Masking with Apollo / GraphQL Anywhere
View createFragmentContainer.js
import React from 'react';
import { filter } from 'graphql-anywhere';
import hoistNonReactStatic from 'hoist-non-react-statics';
/*
* createFragmentContainer returns a component which expects props that match
* WrappedComponent's fragment names, and provides data masking
*/
export default function createFragmentContainer(WrappedComponent) {
View keybase.md

Keybase proof

I hereby claim:

  • I am nickhudkins on github.
  • I am nickhudkins (https://keybase.io/nickhudkins) on keybase.
  • I have a public key ASD1laRxhHGiUOyrE0CJafJIJnwfFRjXWYgTLe6MJY_XsAo

To claim this, I am signing this object:

View SampleGistEmbed.js
export default ({ awesome }) => awesome.map(({ very }) => very
View Dont do this
const myAction = () => {
return (dispatch) => {
dispatch(this)
dispatch(that)
dispatch(otherThing)
dispatch(stopDoingthis)
dispatch(whatareyoudoing)
}
}
@nickhudkins
nickhudkins / TodoList.js
Created Jun 2, 2016
Relevant Fragment Definitions
View TodoList.js
/*...*/
fragments: {
viewer: () => Relay.QL`
fragment on User {
todos(status: $status, first: 2147483647) {
edges {
node {
id,
${Todo.getFragment('todo')},
},
@nickhudkins
nickhudkins / BridgeManager.h
Created Dec 17, 2015
RN Relay "Reset" LOLROFLCOPTER.
View BridgeManager.h
//
// BridgeManager.h
//
// Created by Nick Hudkins on 12/13/15.
//
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@interface BridgeManager : NSObject <RCTBridgeModule>
@nickhudkins
nickhudkins / index.html
Created Aug 22, 2014
A Pen by Nick Hudkins.
View index.html
<div class="pad">
<header>
<a href="" class="logo"></a>
</header>
<div class="container">
<h2>We're growing.</h2>
<p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam id dolor id nibh ultricies vehicula ut id elit. Cras mattis consectetur purus sit amet fermentum.</p>
</div>
<div class="contact-form">
View gist:93f81a089bb3830fd349
(function (g) {
var h = function (a) {
var b = a.oop.createProxy(a),
c = [];
b.addMessageListener = function (a, d) {
return this.baseObject.addMessageListener(a, d) ? (c.push({
name: a,
listener: d
}), !0) : !1
};