// from the flitter/di project - src/Container.js/** * @module flitter-di/src/Container */const MissingContainerDefinitionError = require('./MissingContainerDefinitionError')/** Manages service definitions, instances, and deferred injection. */class Container {  static TYPE_INJECTABLE = Symbol('injectable')  static TYPE_SINGLETON = Symbol('singleton')  /**   * Instantiates the container.   * @param {object} definitions - mapping of service name to static service CLASS definition   */  constructor(definitions = {}) {    const def_map = {}    for ( const def_name in definitions ) {      if ( !definitions.hasOwnProperty(def_name) ) continue      def_map[def_name] = {        type: this.constructor.TYPE_INJECTABLE,        ref: definitions[def_name]      }    }    /**     * Static IoC item definitions from which instances are created or     * singleton values are returned when the items are requested.     * Should be mapping of item_name -> {type: Symbol, ref: *}.     * definition pairs.     * @type {object}     */    this.definitions = def_map    /**     * Instantiated services. If a service has already been requested, it is     * stored here so that the single instance can be reused.     * @type {object}     */    this.instances = {}    /**     * Already injected static service definitions. These are used to resolve     * circular dependencies.     * @type {object}     */    this.statics = {}    /**     * Instance of the dependency injector this container is associated with.     * If this is specified, services will be injected with other services when     * they are instantiated.     * @type {boolean|module:flitter-di/src/DependencyInjector~DependencyInjector}     */    this.di = false    /**     * Array of static class definitions with deferred services. These static     * definitions are waiting for a service to be registered with this container// from the flitter/di project - src/Container.js/** * @module flitter-di/src/Container */const MissingContainerDefinitionError = require('./MissingContainerDefinitionError')/** Manages service definitions, instances, and deferred injection. */class Container {  static TYPE_INJECTABLE = Symbol('injectable')  static TYPE_SINGLETON = Symbol('singleton')  /**   * Instantiates the container.   * @param {object} definitions - mapping of service name to static service CLASS definition   */  constructor(definitions = {}) {    const def_map = {}    for ( const def_name in definitions ) {      if ( !definitions.hasOwnProperty(def_name) ) continue      def_map[def_name] = {        type: this.constructor.TYPE_INJECTABLE,        ref: definitions[def_name]      }    }    /**     * Static IoC item definitions from which instances are created or     * singleton values are returned when the items are requested.     * Should be mapping of item_name -> {type: Symbol, ref: *}.     * definition pairs.     * @type {object}     */    this.definitions = def_map    /**     * Instantiated services. If a service has already been requested, it is     * stored here so that the single instance can be reused.     * @type {object}     */    this.instances = {}    /**     * Already injected static service definitions. These are used to resolve     * circular dependencies.     * @type {object}     */    this.statics = {}    /**     * Instance of the dependency injector this container is associated with.     * If this is specified, services will be injected with other services when     * they are instantiated.     * @type {boolean|module:flitter-di/src/DependencyInjector~DependencyInjector}     */    this.di = false    /**     * Array of static class definitions with deferred services. These static     * definitions are waiting for a service to be registered with this container// from the flitter/di project - src/Container.js/** * @module flitter-di/src/Container */const MissingContainerDefinitionError = require('./MissingContainerDefinitionError')/** Manages service definitions, instances, and deferred injection. */class Container {  static TYPE_INJECTABLE = Symbol('injectable')  static TYPE_SINGLETON = Symbol('singleton')  /**   * Instantiates the container.   * @param {object} definitions - mapping of service name to static service CLASS definition   */  constructor(definitions = {}) {    const def_map = {}    for ( const def_name in definitions ) {      if ( !definitions.hasOwnProperty(def_name) ) continue      def_map[def_name] = {        type: this.constructor.TYPE_INJECTABLE,        ref: definitions[def_name]      }    }    /**     * Static IoC item definitions from which instances are created or     * singleton values are returned when the items are requested.     * Should be mapping of item_name -> {type: Symbol, ref: *}.     * definition pairs.     * @type {object}     */    this.definitions = def_map    /**     * Instantiated services. If a service has already been requested, it is     * stored here so that the single instance can be reused.     * @type {object}     */    this.instances = {}    /**     * Already injected static service definitions. These are used to resolve     * circular dependencies.     * @type {object}     */    this.statics = {}    /**     * Instance of the dependency injector this container is associated with.     * If this is specified, services will be injected with other services when     * they are instantiated.     * @type {boolean|module:flitter-di/src/DependencyInjector~DependencyInjector}     */    this.di = false    /**     * Array of static class definitions with deferred services. These static     * definitions are waiting for a service to be registered with this container

posts & updates

Craigslist

Craigslist

Computer Parts for Sale - Lawrence, KS

I recently switched to a Dell XPS 15 as my daily driver. So, I'm parting-out my other machines that I don't use.

If you live in or near Lawrence, KS, and have any interest, I'm offering pretty good prices for a budget gaming rig:

permalink  |  6/30/2020, 10:23:20 AM

Code Release

Code Release

Feed Page, RSS, & Atom - Minor Website Updates I recently made some tweaks to my website. I added a dedicated page as a historical archive for these updates.

I also added the ability to subscribe to this feed using RSS, Atom, and JSON thanks to a handy NPM package.

permalink  |  5/8/2020, 7:30:33 PM

Code Release

Code Release

VuES6 - ES6 Vue.js Components, in Plain JavaScript

I recently released a small utility library for defining Vue components as proper ES6 classes, but in vanilla JavaScript. I like to use this in small projects where I don't want to have to set up vue-cli and compile templates. More info here.

permalink  |  4/22/2020, 6:17:15 PM

Side Project

Side Project

Connect-4 Webtoy

I've built a simple Connect-4 webtoy as a project for EECS 368 at the University of Kansas. You can play with it here.

permalink  |  4/8/2020, 9:20:25 AM

Blog Post

Blog Post

Code Freedom with Gitea & Drone - Part I

In my never-ending quest to self-host all the things, I've deployed a combination of Gitea and Drone CI for a feature-for-feature, self-hosted alternative to GitHub. Here's how.

permalink  |  3/6/2020, 11:10:49 PM

HackKU 2020

HackKU 2020

Noded - Free-Form Notes & Databases

I recently attended the annual University of Kansas hackathon, where me and a couple friends built Noded.

Noded is a tree-based note taking app based on reusable page elements. It provides support for basic notes, uploaded files, a built-in code editor, customizable databases, static website exports, and sub-tree sharing. Check it out here.

permalink  |  2/24/2020, 7:28:06 PM

Code Release

Code Release

flitter-di@0.1

Flitter-DI is the second-generation dependency-injector used by the Flitter framework. It was pulled from the libflitter project in the hope that it can remain independent from the rest of Flitter and can be used in other projects. More info here.

permalink  |  12/19/2019, 3:19:39 PM

Blog Post

Blog Post

Dependency Injection in Less Than 100 Lines of Pure JavaScript

DI is a powerful pattern for segmenting code to keep it efficient and easy to reuse. In this article, we're going to build a basic DI in <100 lines of pure ES6. Read about it here.

permalink  |  11/16/2019, 1:18:49 PM

Blog Post

Blog Post

A New Platform - My Relentless Pursuit of Privacy

I've finally moved the home of my blog from Medium.com over to a self-hosted Hexo blog. Why? Read more here.

permalink  |  11/15/2019, 1:49:14 AM

Code Release

Code Release

flitter-auth@0.13

This release of Flitter's auth provider brings an OAuth2 server, OAuth2 client, and refinements to the login flow structure. More details here.

permalink  |  11/1/2019, 11:19:46 AM

Speaking

Speaking

Computing in the Kubernetes Framework

Recently I had the pleasure of presenting at the University of Kansas' Center for Research Methods and Data Analysis Weekly Colloquium. You can find resources from my talk on using k8s for scientific computing here.

permalink  |  11/1/2019, 10:49:18 AM

Blog Post

Blog Post

Building a Raspberry Pi Cluster - Part 3

In the third installment of my miniature-HPC series, we discuss OpenMPI, Python3, and running parallel jobs. Read more here.

permalink  |  11/1/2019, 10:46:47 AM

Garrett Mills
Copyright © 2020 Garrett Mills