// from the garrettmills/daton project - lib/src/lifecycle/AppClass.tsimport Instantiable from '../../../di/src/type/Instantiable.ts'import {DependencyKey} from '../../../di/src/type/DependencyKey.ts'import {make} from '../../../di/src/global.ts'import Application from '../lifecycle/Application.ts'/** * Base type for a class that supports binding methods by string. */export interface Bindable {  get_bound_method(method_name: string): (...args: any[]) => any}/** * Returns true if the given object is bindable. * @param what * @return boolean */export function isBindable(what: any): what is Bindable {  return (    what    && typeof what.get_bound_method === 'function'    && what.get_bound_method.length === 1    && typeof what.get_bound_method('get_bound_method') === 'function'  )}/** * Base class for Daton-interactive classes. Provides helpful utilities for accessing * the underlying application and IoC container. */export default class AppClass {  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected static make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.   * @type Application   */  protected static get app() {    return make(Application)  }  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.// from the garrettmills/daton project - lib/src/lifecycle/AppClass.tsimport Instantiable from '../../../di/src/type/Instantiable.ts'import {DependencyKey} from '../../../di/src/type/DependencyKey.ts'import {make} from '../../../di/src/global.ts'import Application from '../lifecycle/Application.ts'/** * Base type for a class that supports binding methods by string. */export interface Bindable {  get_bound_method(method_name: string): (...args: any[]) => any}/** * Returns true if the given object is bindable. * @param what * @return boolean */export function isBindable(what: any): what is Bindable {  return (    what    && typeof what.get_bound_method === 'function'    && what.get_bound_method.length === 1    && typeof what.get_bound_method('get_bound_method') === 'function'  )}/** * Base class for Daton-interactive classes. Provides helpful utilities for accessing * the underlying application and IoC container. */export default class AppClass {  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected static make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.   * @type Application   */  protected static get app() {    return make(Application)  }  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.// from the garrettmills/daton project - lib/src/lifecycle/AppClass.tsimport Instantiable from '../../../di/src/type/Instantiable.ts'import {DependencyKey} from '../../../di/src/type/DependencyKey.ts'import {make} from '../../../di/src/global.ts'import Application from '../lifecycle/Application.ts'/** * Base type for a class that supports binding methods by string. */export interface Bindable {  get_bound_method(method_name: string): (...args: any[]) => any}/** * Returns true if the given object is bindable. * @param what * @return boolean */export function isBindable(what: any): what is Bindable {  return (    what    && typeof what.get_bound_method === 'function'    && what.get_bound_method.length === 1    && typeof what.get_bound_method('get_bound_method') === 'function'  )}/** * Base class for Daton-interactive classes. Provides helpful utilities for accessing * the underlying application and IoC container. */export default class AppClass {  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected static make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.   * @type Application   */  protected static get app() {    return make(Application)  }  /**   * Use the IoC container to create an instance of the given class.   * @param {Instantiable|DependencyKey} target - the key to instantiate   * @param {...any} parameters - parameters to pass to the constructor   */  protected make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {    return make(target, ...parameters)  }  /**   * Get the Daton app.

posts & updates

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, 11:17:15 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, 9:19:39 PM

Blog Post

Blog Post

How to Code From Home Like a Boss

With the current need to work from home, I've put together a list of tricks and tools I use to do my work as a software developer remotely, and discuss the challenges. Here's what I use.

permalink  |  2020-07-23T09:15:49.731Z

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  |  2020-05-09T00:30:33.192Z

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  |  2020-04-08T14:20:25.849Z

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  |  2020-03-07T05:10:49.731Z

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  |  2020-02-25T01:28:06.154Z

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  |  2019-11-16T19:18:49.804Z

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  |  2019-11-15T07:49:14.346Z

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  |  2019-11-01T16:19:46.584Z

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  |  2019-11-01T15:49:18.769Z

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  |  2019-11-01T15:46:47.194Z

Garrett Mills
Copyright © 2020 Garrett Mills