Skip to content

Instantly share code, notes, and snippets.

View bsgreenb's full-sized avatar

Benjamin Greenberg bsgreenb

View GitHub Profile
@bsgreenb
bsgreenb / Grid.tsx
Created July 5, 2020 19:15
GlowyStuff Grid V1
import React, { ReactNode } from "react";
import {
SpacerSizeProp,
spacerSizeBaseEm,
spacerSizeEm,
} from "../../styles/layout";
import {
DirectionProp,
JustifyProp,
AlignContentProp,
@bsgreenb
bsgreenb / storybook-gatsby.ts
Last active May 5, 2020 21:43
Setting up Storybook on Gatsby/Typescript
// 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: [
"@storybook/preset-create-react-app",
"@storybook/addon-a11y",
"@storybook/addon-actions",
@bsgreenb
bsgreenb / output.bash
Created December 24, 2019 19:24
Maximum call stack Bug on Gatsby/Contentful
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'predevbuild', 'devbuild', 'postdevbuild' ]
npm info lifecycle [email protected]~predevbuild: [email protected]
npm info lifecycle [email protected]~devbuild: [email protected]
> [email protected] devbuild /Users/ben/sources/glowyshit
> GATSBY_ACTIVE_ENV=development gatsby build && gatsby serve
Environment detected as: development
{
"contentTypes": [
{
"sys": {
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "recq25x3mcro"
}
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
"""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."""
# For the actual business logic around syncing new events to asana
# TODO: optimize asana api calls
# TODO: replace logs with logger. per https://guides.rubyonrails.org/debugging_rails_applications.html
class Syncer
def initialize
@asana = AsanaAPI.new
@tag_parser = TagParser.new
end
def sync_projects
def generic_render(path, flash_hash = {})
flash_hash.each do |k, v|
flash.now[k] = v
end
if xhr?
@modal_path = path
render 'shared/modal_replace'
else
render path
agent.pre_connect_hooks << Proc.new do |agent, request|
puts { :method => request.method, :path => request.path, :headers => request.to_hash, :post_params => request.body }
end
agent.post_connect_hooks << Proc.new do |agent, uri, response, body|
puts { :status_code => response.code, :response_headers => response.to_hash, :mechanize_response_body => body, :mechanize_uri => uri}
end
Error in processing of request from 192.168.1.26:40407
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/netlib/tcp.py", line 375, in request_thread
self.handle_connection(request, client_address)
File "/Library/Python/2.7/site-packages/libmproxy/proxy.py", line 509, in handle_connection
h.handle()
File "/Library/Python/2.7/site-packages/libmproxy/proxy.py", line 177, in handle
while self.handle_request(cc) and not cc.close:
File "/Library/Python/2.7/site-packages/libmproxy/proxy.py", line 193, in handle_request
request = self.read_request(cc)