Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Matthew Stokeley matthewstokeley

🎯
Focusing
Block or report user

Report or block matthewstokeley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthewstokeley
matthewstokeley / manifest.json.md
Last active Nov 19, 2019
Example PWA manifest
View manifest.json.md

<link rel="manifest" href="/manifest.json">

From the google documentation:

{
  "short_name": "Maps",
  "name": "Google Maps",
  "icons": [
    {
      "src": "/images/icons-192.png",
View graphql-api.md

Queries

Fields

An object property

{
  hero {
    name
View gist:4f5c8d072eb02a9a5d4670204847b9ec
/**
*
* Triggers aspect-ratio computation in chromium browsers
*/
@mixin _aspect-ratio
width: 100%
height: auto
@matthewstokeley
matthewstokeley / white-space.sass
Created Sep 13, 2019
a discarded white-space mixin with a robust parameter range
View white-space.sass
@mixin white-space( $options, $vertical: true )
$box-model-white-space: ()
$prop: null
@if ( type-of($options) == 'map' )
@each $rel, $map in $options
@if ( $rel != 'inner' and $rel != 'outer' )
$prop: 'padding'
@each $modifier, $unit in $options
#{ $prop }-#{ $modifier }: #{ $unit }
@matthewstokeley
matthewstokeley / expected.md
Last active Sep 29, 2019
the use of an `expected` parameter to mock data values
View expected.md

The expected pattern for handling unknown data sources from React's ssr rendering library, in this case a data-attribute value, provides an alternative to event propagation and graceful degradation for error handling.

  • is the attribute name safe?
    • if no, return
  • does the node have the attribute?
    • if no, return a value of null unless expected is undefined, in which case, return undefined.
  • assign the value of getAttribute
  • is the value equal to an empty string? return expected
    • otherwise, return the value
@matthewstokeley
matthewstokeley / err.md
Last active Oct 18, 2019
error constants definition file
View err.md
/**
 *   A set of conventional error, exception and warning messages.
 *   Organized by type and then hierarchically according to specificity, from `SPL`, python and node.js
 *   @version 0.0.1
 */
 
/*_______________________________________________________________
 * 
 *   Parameter Error Messages
@matthewstokeley
matthewstokeley / paragraphs.js
Last active Oct 6, 2019
very quick sketch of several services to provide transformation to paragraphs
View paragraphs.js
/*---------------------------------
*
* Real-time data analysis library
* @ht lewitt
*/
// modularizing paragraphs and allowing granular control over transformation
type TransformationObject {
@matthewstokeley
matthewstokeley / match.js
Last active Sep 29, 2019
a very quick sketch of a spark-inspired transformation layer that sites on top of a mongo-esque nlp api - meant to listen to node streams
View match.js
/*---------------------------------
*
* Real-time data analysis library
*
*/
// transformation layer for node streams
// - listen to node stream
// - create a transformation object on event listener
@matthewstokeley
matthewstokeley / lazy-load.html
Last active Nov 19, 2019
native image lazy loading with fall back
View lazy-load.html
<!-- -->
<img src="" srcset="" loading="lazy" data-lazy-load="true" alt="" />
<script>
if ( HTMLImageElement.prototype.loading === undefined ) {
// load lazy loading plugin
}
</script>
You can’t perform that action at this time.