Skip to content

Instantly share code, notes, and snippets.

View jonboiser's full-sized avatar

Jonathan Boiser jonboiser

View GitHub Profile
alfred font-fira-mono font-roboto-mono java spotify
atom font-hack font-source-code-pro karabiner tower
bartender font-hasklig gitup seil Untitled.ipynb (!)
font-fantasque-sans-mono font-inconsolata-lgc google-chrome sketch Untitled1.ipynb (!)
font-fira-code font-mononoki gpgtools slack visual-studio-code
/* @flow */
// daggy.tagged(arguments)
//declare module 'daggy' {
declare function tagged<T>(...args: string[]): (...xs: Array<T>) => {[k: string]: T};
//}
//import daggy from 'daggy';
var Tuple3 = tagged('x', 'y', 'z');
declare module 'reflexbox' {
declare type Range6 = 0 | 1 | 2 | 3 | 4 | 5 | 6;
declare type Range12 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
declare type BaseProps = {
auto?: boolean,
gutter?: number,
col?: Range12,
sm?: Range12,
@jonboiser
jonboiser / rtg.scss
Created January 12, 2017 22:29
rtg example
@media (min-width: 769px) {
.mark-all-read{
margin-left: auto;
}
}
@media (max-width: 768px) {
.date-time{
font-size: 1rem;
}
# initialization file (not found)
@jonboiser
jonboiser / khan academy topics.txt
Created June 8, 2017 22:28
khan academy topics 'slugs' list
"1-digit-multiplication-division"
"1600s-1800s"
"16th-18th-century"
"1920s-america"
"1950s-america"
"1960s-america"
"1970s-america"
"1980s-america"
"1990s-america"
"19th-century"

Organizing Page States in Vuex Modules

Summary

Prior to this pull request, the pattern for rendering pages was as follows:

  1. When browser goes to a route, the router executes a handler function (with a name like showClassesPage)
  2. The handler will have some standard effects on the Vuex store (e.g. show loading page, update a pageName field that matches the route's name, etc.). It will usually request some data from the server and then terminate by committing a SET_PAGE_STATE mutation that copies that server data into Vuex inside of the pageState field.
  3. The Vue component that is mapped to pageName will render and pull the data it needs to present from pageState.

After this Pull Request, this flow changes in the following manner:

from kolibri.core.auth.models import FacilityUser, Facility, Role
from faker import Faker
"""
pip install Faker if you don't have it
"""
FAKE = Faker()
"""
@jonboiser
jonboiser / machine.js
Last active August 24, 2020 17:22
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions