Skip to content

Instantly share code, notes, and snippets.

sender chooses whether to communicate
(noise|barriers)
sender chooses intended receivers (experience graph for each)
(noise|barriers) barrier: architecture prevents
for each intended receiver:
sender chooses concepts to communicate (noise|barriers) (experience graph for each)
sender maps own concepts to receiver concepts (noise|barriers)
sender encodes receiver concepts to language
syntax: (noise|barriers)
semantics: (noise|barriers)
@a-laughlin
a-laughlin / js_module_notes.txt
Last active September 24, 2020 01:34
js module notes for team dojo
different kinds of modules through JS history
name year sync async encapsulatable immutable dependency defs dep resolution code example
-------
namespaces 2000: yes no no no none manual var App = {};
revealing module 2005: yes no yes no global variables manual var myModule = (function($){return {fetch:$.get}})(jQuery)
CommonJS 2009: yes no yes yes file names graph module.exports={foo:'bar'} const foo = require('foo').foo
AMD 2009: no yes yes no file names graph define(['jQuery','Application'],($,App)=>{}), require('foo',(foo)=>{...use foo...})
ES modules 2016: yes yes yes yes sub-file parts graph import {foo} from 'foo', export const foo='bar'; import('foo').then((module)=>module.foo)
var mufasa = {
name: "Mufasa",
sing() {
var inner = function() {
console.log("inner:this", this);
};
var innerStrict = function() {
'use strict';
console.log("innerStrict:this", this);
};
var mufasa = {
name: "Mufasa",
sing() {
var inner = function() {
console.log("inner:this", this);
};
var innerStrict = function() {
'use strict';
console.log("innerStrict:this", this);
};
@a-laughlin
a-laughlin / lexical_and_variable_environments.md
Created July 25, 2020 01:53
execution context, lexical environments, variable environments

example to illustrate variable values in different scopes, in both assignment and re-assignment cases.

... html here ...
<script>
// Scope chain example, showing lexical and variable environments in a call tree.
// "this" is always window
// [name] is execution context. E.g., "win" is the window execution context.
// "[name]Vars" corresponds to [name]'s variable environment (function scoped, identifiers defined with var, and function args)
// "[name]Lexs" corresponds to [name]'s lexical environment (block scoped, identifiers defined with const and let)
@a-laughlin
a-laughlin / react-app-time-progression.txt
Last active September 30, 2019 19:01
React UI App Progression time steps, for graph decomposition per step.
// assumes create-react-app, and files served from src/
T0: define time
file tree exists. Nothing imported. Static intra-file code graphs exist.
T1: JS run time starts.
index.js imports files:
Functions in imported files run: JS graphs updated.
Conceptual component graph exists.
T2: React run time starts
App Component runs. Virtual dom root exists.
loop:
@a-laughlin
a-laughlin / gh_projects_issue_creator.js
Last active March 4, 2019 00:55
Bookmarklet To Create New Github Projects Issues Using Template
javascript:((alert,$)=>{
const story_template = '### Story\nAs a ___, I should be able to ___, so that ___.\n\n### Acceptance Criteria\n - [ ] __\n - [ ] __\n - [ ] __\n - [ ] Tests Written (TDD)\n - [ ] Code Written\n - [ ] Documentation Written in Relevant Readme\n\n### Depends On\n- NA\n\n### Relates To\n- NA';
/*utility*/
const poll = (interval=100,maxwait=1000)=>(predicate,msg)=>(new Promise((res,rej)=>{
let waited = -1;
const t = setInterval(()=>{
const passes = predicate();
if(passes){clearInterval(t);res(passes);}
if((waited+=interval)>=maxwait) {clearInterval(t);rej(msg);}
},interval);
@a-laughlin
a-laughlin / command-line-reference.md
Last active May 8, 2024 11:15
Command Line Reference bash sed diff awk vim
@a-laughlin
a-laughlin / python_a_reference.md
Last active January 29, 2026 07:28
python reference

Python Reference

CheatSheets

Python Basics: Data Science

importing data

python 3 (pt 1 of 2)

python 3 (pt 2 of 2)

@a-laughlin
a-laughlin / discrete_math_reference.rtf
Last active June 5, 2019 22:55
Discrete Math Reference Table
https://docs.google.com/spreadsheets/d/1-2aTdkutAdywzBSHjpiK7zGMAczX_QW6euPczfyxa68/edit#gid=0