This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make all properties in T deeply non-nullable recursively | |
type DeepNonNullable<T> = T extends object | |
? { [K in keyof T]-?: DeepNonNullable<NonNullable<T[K]>> } | |
: NonNullable<T>; | |
/** | |
* Creates a proxy that builds a dotted path string based on property access | |
* while restricting property access to only those defined in the generic type T. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handler(event) { | |
const request = event.request; | |
const uri = request.uri; | |
const parts = uri.split("/"); | |
const lastPart = parts[parts.length - 1]; | |
const isAssetRequest = lastPart.includes("."); | |
const isDirectoryRequest = uri.endsWith("/"); | |
const needsTrailingSlash = !isAssetRequest && !isDirectoryRequest; | |
if (needsTrailingSlash) { | |
const host = request.headers.host.value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When using an Input field in which you would like to enforce validation at query validation time | |
// via.... types, you will need a custom JSON marshaller, as well as a `ScalarType` to allow for... | |
// custom scalar types to be used as an Input. This does not come up as often for custom output types | |
// as `.toString` allows for most complex types to be easily serialized as a `String` | |
object LocaleSupport { | |
import io.circe.Decoder | |
private val VIOLATION_MESSAGE = "Invalid Locale Provided" | |
// Custom Java Exception |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default ({ awesome }) => awesome.map(({ very }) => very |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myAction = () => { | |
return (dispatch) => { | |
dispatch(this) | |
dispatch(that) | |
dispatch(otherThing) | |
dispatch(stopDoingthis) | |
dispatch(whatareyoudoing) | |
} | |
} |
NewerOlder