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 / fetch-wrapper.js
Last active Feb 21, 2020
a robust application lifecycle built around the fetch web api
View fetch-wrapper.js
// quick sketch
/**
* Contextual piping
*/
const pipe = function() {
let res
for ( let i = 0; i < this.length; i++ ) {
if ( typeof this[ i ] === 'Function' ) {
View symbol-keys.js
// immutable, unique symbols are used for keys.
let key = new Symbol("md5")
const hashTable = {
[key] : {}
}
@matthewstokeley
matthewstokeley / event-driven-data-mapping.js
Last active Feb 21, 2020
functional, compositional event-based data mapping with dependency injection and closures
View event-driven-data-mapping.js
// an object mutator for a functional, compositional event-based data mapper with closures
const store = {}
const shallowCloneObject = store => Object.assign({}, store)
// const store = shallowCloneObject(original)l
function defineProperty (
object: Object,
View pure-function-patterns.md

/**
 * ht vue, lo
 * Cache a function
 */
function cached (
  fn: Function,
  resolver: Function
): Function {
View hyper-app-event-payload-methods.md

Deep diving hyper's event system

@link pure-programming-with-hyper-app
  ```

This is the generated function that is passed inside of the event-systems payload

  ```	
  	wrap = function ( data ) {
@matthewstokeley
matthewstokeley / app.js
Last active Feb 16, 2020
hyper boilerplate
View app.js
const html = hyperx(hyperapp.h)
const model = 0
const click = model => model + 1
const actions = {click}
const view = (model, actions) => {
return html`
<div>
<h1>Clicked ${model}</h1>
<button onClick=${actions.click}>click</button>
</div>
@matthewstokeley
matthewstokeley / javascript-composition.js
Last active Feb 9, 2020
composition and javascript
View javascript-composition.js
// composition and javascript
// @todo review
// composition is often contrasted with inheritance as a mechanism for allowing different components,
// modules or classes to communicate. both inheritance and composition are considered highly coupled -
// composition is less coupled than inheritance.
// object-oriented composition with dependency injection
class Book {
@matthewstokeley
matthewstokeley / modular-dependencies.config.toml
Created Feb 8, 2020
modular-dependencies-config-file-boilerplate
View modular-dependencies.config.toml
[application-framework]
framework = "vue"
[ci]
vendor = "circleci"
[component-tests]
framework = "storybook"
[development-environment]
View gist:0725ec2e6c01db12191e27d5fe063dcf
#! /usr/bin/bash
# @version 0.0.1
# @todo integrate with node-express-boilerplate
if [ config.js -e ]
then
touch config.js
fi
echo "ENV=DEVELOPMENT" >> config.js
You can’t perform that action at this time.