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
@relwell
relwell / zappa_async_fix.py
Created August 26, 2019 17:20
zappa async fix
"""
THIS IS BASICALLY A MONKEY-PATCH OF BROKEN BEHAVIOR IN ZAPPA
Zappa sends bytes to boto instead of a string.
Zappa Async Tasks
Example:
```
from zappa.async import task
=> Compling assets in current project directory
=> Copying current project directory to temporary build area: /tmp/jets/ut-search/stage/code
=> Reconfiguring webpacker development settings for AWS Lambda.
Jets sends data about your gems to your specified lambda build service **lambdagems.com** so that it can compile and generate the necessary Lambda layers. Lambdagems only collects anonymous non-identifiable data.
@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-)
@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
# 397 results
query {
searchProducts(q:"Xl" fields:"title,size") {
total
edges {
node {
source
}
}
}
# Query
query {
synonyms {
id
text
}
}
# Response
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!) {
"Mappings": {
"EnvironmentMap": {
"qa": {
"lambdaSubnets": "subnet-1c6a4634,subnet-aadf34dd" ,
"lambdaSecurityGroups": "sg-b58c1ad0,sg-007b3e50d822ab4b6"
},
"prod": {
"lambdaSubnets": "subnet-076822f8311733aa2,subnet-01be8dd54e536738b",
"lambdaSecurityGroups": "sg-015d3589ebaddb5ef",
}
query crowdAggBuckets($q:String! $crowdAgg:String! {
crowdAggBuckets(params:{
q:$q
agg:$crowdAgg
}) {
aggs{
buckets {
key
}
}
query getCrowdFacets($q:String)
aggBuckets(params:{
q: $q
agg: "front_matter_keys"
}) {
aggs {
buckets {
key
}
}