Skip to content

Instantly share code, notes, and snippets.


Ben Greenberg bsgreenb

  • San Francisco, CA
View GitHub Profile
bsgreenb / Grid.tsx
Created Jul 5, 2020
GlowyStuff Grid V1
View Grid.tsx
import React, { ReactNode } from "react";
import {
} from "../../styles/layout";
import {
bsgreenb / storybook-gatsby.ts
Last active May 5, 2020
Setting up Storybook on Gatsby/Typescript
View storybook-gatsby.ts
// Pre-req step: gatsby-plugin-typescript, storybook cli installation per docs...
// Then, here's custom config to support Gatsby/Typescript..:
// .storybook/main.ts
export = {
stories: ["../src/ui/**/*.stories.ts", "../src/ui/**/*.stories.tsx"],
addons: [
bsgreenb / output.bash
Created Dec 24, 2019
Maximum call stack Bug on Gatsby/Contentful
View output.bash
npm info using npm@6.13.4
npm info using node@v12.10.0
npm verb run-script [ 'predevbuild', 'devbuild', 'postdevbuild' ]
npm info lifecycle glowyshit@0.0.1~predevbuild: glowyshit@0.0.1
npm info lifecycle glowyshit@0.0.1~devbuild: glowyshit@0.0.1
> glowyshit@0.0.1 devbuild /Users/ben/sources/glowyshit
> GATSBY_ACTIVE_ENV=development gatsby build && gatsby serve
Environment detected as: development
View contentful-export-recq25x3mcro-staging-2019-10-30T15-18-14.json
"contentTypes": [
"sys": {
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "recq25x3mcro"
View graphqlTypes.ts
export type Maybe<T> = T | null;
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string,
String: string,
Boolean: boolean,
Int: number,
Float: number,
* A date string, such as 2007-12-03, compliant with the ISO 8601 standard for
View schema.graphql
"""Provides default value for input field."""
directive @default(value: JSON!) on INPUT_FIELD_DEFINITION
"""Add date formating options."""
directive @dateformat(formatString: String, locale: String, fromNow: Boolean, difference: String) on FIELD_DEFINITION
"""Link to node by foreign-key relation."""
directive @link(by: String! = "id", from: String, on: String) on FIELD_DEFINITION
"""Link to File node by relative path."""
View asana_syncer.rb
# For the actual business logic around syncing new events to asana
# TODO: optimize asana api calls
# TODO: replace logs with logger. per
class Syncer
def initialize
@asana =
@tag_parser =
def sync_projects
View application_controller.rb
def generic_render(path, flash_hash = {})
flash_hash.each do |k, v|[k] = v
if xhr?
@modal_path = path
render 'shared/modal_replace'
render path
View gist:8019637
agent.pre_connect_hooks << do |agent, request|
puts { :method => request.method, :path => request.path, :headers => request.to_hash, :post_params => request.body }
agent.post_connect_hooks << do |agent, uri, response, body|
puts { :status_code => response.code, :response_headers => response.to_hash, :mechanize_response_body => body, :mechanize_uri => uri}
View gist:7887936
Error in processing of request from
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/netlib/", line 375, in request_thread
self.handle_connection(request, client_address)
File "/Library/Python/2.7/site-packages/libmproxy/", line 509, in handle_connection
File "/Library/Python/2.7/site-packages/libmproxy/", line 177, in handle
while self.handle_request(cc) and not cc.close:
File "/Library/Python/2.7/site-packages/libmproxy/", line 193, in handle_request
request = self.read_request(cc)