Skip to content

Instantly share code, notes, and snippets.

View bsgreenb's full-sized avatar

Benjamin Greenberg bsgreenb

View GitHub Profile
----------------------------------------
192.168.1.26 GET http://api.geo.kontagent.net/api/v1/923c9d03ca064230ae8b651fc19d31e4/pgr/?ts=1386667004&s=6788175933295711483&kt_v=a1.3.1
<< 200 OK 2B
----------------------------------------
Error in processing of request from 192.168.1.26:34248
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/netlib/tcp.py", line 369, 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()
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)
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
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
# 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
"""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."""
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
{
"contentTypes": [
{
"sys": {
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "recq25x3mcro"
}
@bsgreenb
bsgreenb / output.bash
Created December 24, 2019 19:24
Maximum call stack Bug on Gatsby/Contentful
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
@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",