This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Marshmallow is a Python library for dealing with complex data types. | |
It’s especially useful as an ORM layer between a database and the interface of a Python API or UI. | |
Example code from https://marshmallow.readthedocs.io/en/stable/quickstart.html | |
To start, in an existing Python project: | |
``` | |
pip install -U marshmallow | |
``` | |
Create a schema: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stripes-components/lib/CurrentUser/CurrentUser.js | |
export const CurrentUserContext = React.createContext({ | |
timeZone: 'UTC' | |
// all the other things that hang on context.stripes also go here | |
}); | |
export default function withCurrentUser(Component) { | |
return ({ currentUser, ...props }) => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stripes-components/lib/CurrentUser/CurrentUser.js | |
export const CurrentUserContext = React.createContext({ | |
timeZone: 'UTC' | |
// all the other things that hang on context.stripes also go here | |
}); | |
export default function withCurrentUser(Component) { | |
return ({ currentUser, ...props }) => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stripes-components/lib/CurrentUser/CurrentUser.js | |
export const CurrentUserContext = React.createContext({ | |
timeZone: 'UTC' | |
// all the other things that hang on context.stripes also go here | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stripes-components/lib/Datepicker/Datepicker.js | |
import withTimeZone from '../TimeZone'; | |
class Datepicker extends Component { | |
static propTypes = { | |
timeZone: PropTypes.string.isRequired | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import classNames from 'classnames/bind'; | |
import capitalize from 'lodash/capitalize'; | |
import PaneHeader from '@folio/stripes-components/lib/PaneHeader'; | |
import Icon from '@folio/stripes-components/lib/Icon'; | |
import IconButton from '@folio/stripes-components/lib/IconButton'; | |
import PaneMenu from '@folio/stripes-components/lib/PaneMenu'; | |
import Modal from '@folio/stripes-components/lib/Modal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |