Skip to content

Instantly share code, notes, and snippets.

View relwell's full-sized avatar
😎
keeping it 💯

Robert Elwell relwell

😎
keeping it 💯
View GitHub Profile
query {
aggBuckets(params:{
agg: "facility_states"
}) {
aggs {
name
docCountErrorUpperBound
sumDocOtherCount
buckets {
key
import React from 'react';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import _ from 'lodash';
class SomeComponent extends React.Component {
render() {
const someFieldMap = { nctId: 'nct_id', averageRating:'average_rating' };
const fields = _.map(someFieldMap, (value, key) => `${key}:field(name:"${value}")`);
const query = gql`
query getCrowdFacets($q:String)
aggBuckets(params:{
q: $q
agg: "front_matter_keys"
}) {
aggs {
buckets {
key
}
}
query crowdAggBuckets($q:String! $crowdAgg:String! {
crowdAggBuckets(params:{
q:$q
agg:$crowdAgg
}) {
aggs{
buckets {
key
}
}
"Mappings": {
"EnvironmentMap": {
"qa": {
"lambdaSubnets": "subnet-1c6a4634,subnet-aadf34dd" ,
"lambdaSecurityGroups": "sg-b58c1ad0,sg-007b3e50d822ab4b6"
},
"prod": {
"lambdaSubnets": "subnet-076822f8311733aa2,subnet-01be8dd54e536738b",
"lambdaSecurityGroups": "sg-015d3589ebaddb5ef",
}
import React from 'react';
import { compose, graphql } from 'react-apollo';
// i actually recommend .graphql files with the webpack loader from this library
import { gql } from 'graphql-tag';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import CircularProgress from '@material-ui/core/CircularProgress';
const entryQuery = gql`
query lookupEntry($key: String!) {
# Query
query {
synonyms {
id
text
}
}
# Response
# 397 results
query {
searchProducts(q:"Xl" fields:"title,size") {
total
edges {
node {
source
}
}
}
@relwell
relwell / .gitextensions
Created June 4, 2019 14:06
Git Branching with Trello
#!/bin/bash -e
card_branch_name() {
if [ ! -n "${UT_TEAM}" ]; then
echo "\$UT_TEAM not set!" && return 1;
fi
project=$1
url=$2
@relwell
relwell / spec-changed
Created June 25, 2019 20:02
Run rspec on all changed spec files at once
#!/bin/bash -e
bundle exec rspec $(git status | grep spec | grep "modified:" | cut -b 14-)