Driven by UTS
- Create Collection
- typeName
| // Requires `node-usb` https://github.com/nonolith/node-usb | |
| var usb = require('usb'); | |
| // Get the switch by its vendor and product ids. | |
| var switchDevice = usb.findByIds(0x050D, 0x0201); | |
| // Open the device for communication. | |
| switchDevice.open(); | |
| // From the **inactive** computer, send the control trnasfer request with the value `[0x02, 0x00]` to trigger the switch. |
| function Bindable(ClassRef, onChangeMethodName){ | |
| class BindableClass{ | |
| constructor(...args){ | |
| const instance = new (ClassRef.bind(this))(...args); | |
| for(const k in instance){ | |
| if(instance.hasOwnProperty(k)){ | |
| const initialValue = instance[k]; | |
| const privatePropertyName = `_${k}`; | |
| instance[privatePropertyName] = initialValue; |
| import React, { Component } from 'react'; | |
| export default class FluxDI { | |
| static validateContextName(name){ | |
| if(typeof name !== 'string'){ | |
| throw new Error('`name` must be a string.'); | |
| } | |
| } | |
| function collate(pages = []){ | |
| const flats = []; | |
| const { length } = pages; | |
| const flatLength = Math.ceil(length/2); | |
| const even = length % 2 === 0; | |
| const newPages = [...pages]; | |
| if(!even){ | |
| const lastPage = newPages.pop(); | |
| // JSDI | |
| class K{ | |
| handler; | |
| constructor(handler){ | |
| this.handler = handler; | |
| } | |
| exec() { |
| // Stub to stop Babel REPL from bitching ;) | |
| class Incarnate { | |
| async resolvePath(){} | |
| } | |
| // Map dependencies. Use nested modules by returning sub-maps from functions. | |
| // The process fully supports async but keeps everything in order of dependencies when resolving. | |
| // Sub-dependencies (args) are aquired in parallel for the quickest result. | |
| // Modules and "connecting everything via string names" are both decoupling techniques that will aid in smooth parallel development. | |
| const depMap = { |
| // Query | |
| { | |
| type: 'OR_SET', | |
| data: [ | |
| { | |
| type: 'AND_SET', | |
| data: [ | |
| { | |
| type: 'CONDITION', | |
| fieldName: 'myField', |
Driven by UTS
| // Type Map | |
| { | |
| PrimitiveType: { | |
| name: 'PrimitiveType', | |
| label: 'Primitive Type', | |
| primitive: true | |
| }, | |
| AnotherType: { | |
| name: 'AnotherType', | |
| label: 'Another Type', |
| .idea/ | |
| node_modules/ |