Skip to content

Instantly share code, notes, and snippets.

View jeancochrane's full-sized avatar
🌵
photosynthesizing

Jean Cochrane jeancochrane

🌵
photosynthesizing
View GitHub Profile
@jeancochrane
jeancochrane / search-map-components.md
Created April 18, 2019 02:29
Notes for how to link up the search and map components in LISC.

1. Reorganize the AwardeeMap component to use local state variables

  • Read the short React guide on Components and Props
  • Read the short React guide on State and Lifecycle stopping when you get to the Adding Lifecycle Methods to a Class section (the rest isn't relevant for this portion of work)
  • In index.js, turn AwardeeMap into a class-based React component
  • Initialize a state attribute, an object containing a markers array,
@jeancochrane
jeancochrane / gatsby-lunch-and-learn.md
Created April 3, 2019 16:55
Notes for Gatsby Lunch&Learn

Lunch&Learn: Gatsby

April 3rd, 2019

What is Gatsby?

Gatsby is a static site generator built on top of React components that uses GraphQL to pull in data from anywhere.

When I first read about Gatsby that description didn't really help me grasp what

Modern JavaScript: A (Brief) Overview

Lunch&Learn | 2019-03-26

What's new in modern JavaScript?

Modules

To make a module's (i.e. a script's) methods or variables useable by another module, export them:

@jeancochrane
jeancochrane / settings.json
Created February 28, 2019 01:15
VSCode settings.
{
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"vim.insertModeKeyBindings": [
{
"before": [
"j",
"k"
],
"after": [
import { Component, Fragment } from 'react'
import { Authenticator } from 'aws-amplify-react'
import CustomHeaderBar from './custom-header-bar'
// Override authentication wrapper to use custom header bar
// based on:
// https://github.com/aws-amplify/amplify-js/blob/master/packages/aws-amplify-react/src/Auth/index.jsx
export default function withAuthenticator (Comp, includeGreetings = false,
authenticatorComponents = [], federated = null, theme = null, signUpConfig = {}) {
vagrant@vagrant:/vagrant$ docker-compose run --rm --service-ports --entrypoint python ahoy manage.py runserver
Starting vagrant_database_1_2a9986757068 ... done
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fa2b51c32f0>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
raise _exception[1]
@jeancochrane
jeancochrane / dbserver.py
Last active January 26, 2018 04:50
🔑 A simple database server, for getting and setting from a key-value store.
#!/usr/bin/env python3
import unittest
import json
import io
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.error import HTTPError
from urllib.request import urlopen
@jeancochrane
jeancochrane / cracklepop.scm
Last active January 11, 2018 01:56
A Scheme implementation of CracklePop!
(define (crackle-pop)
(define (iter n)
(let ((divisible-by-3 (= 0 (remainder n 3)))
(divisible-by-5 (= 0 (remainder n 5))))
(cond ((> n 100) "Done printing CracklePop :~)")
(else
(cond ((or divisible-by-3 divisible-by-5)
(if divisible-by-3 (display "Crackle"))
(if divisible-by-5 (display "Pop")))
(else (display n)))

Where to Buy reloading bug

This guide addresses the selection bugs that caused the Where to Buy Profiles and Priorities to not interact properly with one another.

The fix

The first thing you'll have to do is tweak a little bit of HTML in index.html. Instead of using JS to click on the "City Family" profile, I changed it so that it has the proper classes to look "pre-selected." Find this code block:

<div class="carousel-cell text-center is-selected" id="city-home">