Instantly share code, notes, and snippets.

View requirejs-config.md
var require = {
    baseUrl: "./",
    paths: {
        'react': 'https://cdnjs.cloudflare.com/ajax/libs/react/16.3.0/umd/react.development',
        'react-dom': 'https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.3.0/umd/react-dom.development',
        'text': 'https://cdnjs.cloudflare.com/ajax/libs/require-text/2.0.12/text',
        'json': 'https://cdnjs.cloudflare.com/ajax/libs/requirejs-plugins/1.0.3/json'
    },
    packages: [
View custom-protocol.md

assuming your have node.js installed

this is a self contained minimal example of how your can register a custom protocol and it's handler all relative to your local folder

you need the following files in your folder:

make-dev-protocol-registration.js

const { resolve } = require('path');
View gist:13d1d3ff0bd6d9a324f85d1aecda4baf
- doc for lambdas in js: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
- doc for alexa responses: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#response-examples
- aws logs: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:
- aws lambas: https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions/myFunctionName?tab=graph
- alexa test: https://developer.amazon.com/alexa/console/ask/test
- all skills: https://developer.amazon.com/alexa/console/ask
View scaffolding.md
View inversed-resolver.md

what is a resolver?

  • A resolver is an abstraction that solves the problem of handling each possible case of a sum-type like union or enum.

why wouldn't you use a switch?

  • The switch can only be used when all cases are of specific types (or at least constrained to having a property to be discriminated upon). When we deal with a union of all generics that we don't know anything about, we need some help from outside to narrow them. This is where a resolver comes handy.

what is the catch?

  • It requires a bit of unsoundness in mapping the original sum-type to each specific case which you need to do by hand without any help from the compiler, however practically the benefits outweigh a slight chance of mistake.

what are the benefits?

View disabing-sneaky-features-in-windows.md
  • know what process is connected to where: netstat -a -b -f -o > log.txt
  • run gpedit.msc
  • go Computer Configuration >> Administrative Templates >> Windows Components >> Data Collection and Preview Builds >> Allow Telementry
  • disable
View 3d-printer.md
  • live-z adjustment: -0.980
  • bad correction:
    • left: -20
    • right: 0
    • front: -45
    • rear: 0

3d tools