Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
| require "json" | |
| require "rexml/document" | |
| require "time" | |
| require "unpack_strategy" | |
| require "lazy_object" | |
| require "cgi" | |
| class AbstractDownloadStrategy | |
| extend Forwardable | |
| include FileUtils |
| import React, { createContext, useState, useContext } from "react"; | |
| const context = createContext({ | |
| activeTabId: "a", | |
| changeTab: (id: string) => {} | |
| }); | |
| const Tab = ({ id, children }: any) => { | |
| const tab = useContext(context); | |
| return <div onClick={() => tab.changeTab(id)}>{children}</div>; |
| /** | |
| * toggle-macos-accessibility-keyboard | |
| * javascript for automation (jxa) | |
| * | |
| * description: | |
| * macOS automation script to toggle the macOS Accessibility Keyboard. | |
| * Shows and hides the keyboard depending on its current state. | |
| * | |
| * author: sidneys | |
| * homepage: http://sidneys.github.io |
Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
| const React = require("react"); | |
| const Lifecycles = React.createLifecycleEvents({ | |
| didMount({ setState }) { | |
| setState({ | |
| disabled: false, | |
| }); | |
| }, | |
| didUpdate({ inputRef }) { | |
| if (document.activeElement !== inputRef.value) { |
| // This is an advanced example! It is not typically required for application code. | |
| // If you are using a library like Redux or MobX, use the container component provided by that library. | |
| // If you are authoring such a library, use the technique shown below. | |
| // This example shows how to safely update subscriptions in response to props changes. | |
| // In this case, it is important to wait until `componentDidUpdate` before removing a subscription. | |
| // In the event that a render is cancelled before being committed, this will prevent us from unsubscribing prematurely. | |
| // We also need to be careful about how we handle events that are dispatched in between | |
| // `getDerivedStateFromProps` and `componentDidUpdate` so that we don't put stale values into the `state`. |
| ///////////////////////////////////////////////////////////////////////////////// | |
| // Generating "A Sequence Problem" using iterators, without integers or arrays // | |
| // See http://raganwald.com/2017/06/04/sequences.html // | |
| ///////////////////////////////////////////////////////////////////////////////// | |
| ///////////////////////////////////////////////////////////////////// | |
| // Generic things useful for working with interables and iterators // | |
| ///////////////////////////////////////////////////////////////////// | |
| // 1. These operations produce repeatable iterables. |
| // @flow | |
| function getOptions() { | |
| return { num: 42, str: "val" }; | |
| // ^ Type of this return is inferred without type annotation. | |
| } | |
| /*:: | |
| // ^ Comments like this are part of Flow's Comment Syntax. | |
| // They allow you to include any additional syntax and Flow will parse it |
| package main | |
| import ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "time" | |
| ) |
| {-# LANGUAGE NamedFieldPuns #-} | |
| -- The Expression Problem and my sources: | |
| -- http://stackoverflow.com/questions/3596366/what-is-the-expression-problem | |
| -- http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/ | |
| -- http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/ | |
| -- http://www.ibm.com/developerworks/library/j-clojure-protocols/ | |
| -- To begin demonstrating the problem, we first need some |