(11:00:56)<earendel>n>var module=(function() { var arr=[1,2,3,4,5]; var sum=(a,b)=>a+b; return { items: arr, sum: sum }; })(); module.items.reduce(module.sum); //simple module pattern. just return an object which contains all things that shall be public/accessible to the user/programmer -> exports/interface .. that way you can have all your shit in a single object not polluting the global scope @thevishy
- 13 min, 53 sec
(11:14:49)<earendel>yw. but you wouldn't want it. that module pattern is understood?
(11:19:34)<earendel>oh..maybe i should add: in the browser the global object is window (not in the browser extension context, or service workers tho) .. in node however each file is a module and has it own root scope .. but its really just a function span around it.. x=1 would still be planted onto the global scope when not x is not declared in some inner scope. just do sth like cx={}
REM A Set of requirejs related repositories | |
git clone https://github.com/hagb4rd/ea-webkit.git | |
git clone https://github.com/cssinjs/jss-global.git | |
git clone https://github.com/millermedeiros/requirejs-plugins.git | |
git clone https://github.com/jfparadis/requirejs-mustache.git | |
git clone https://github.com/millermedeiros/requirejs-plugins.git | |
git clone https://github.com/guybedford/require-css | |
git clone https://github.com/requirejs/text.git | |
git clone https://github.com/requirejs/i18n.git |
// | |
// This file is part of ColorZilla | |
// | |
// Written by Alex Sirota (alex @ iosart.com) | |
// | |
// Copyright (c) iosart labs llc 2011, All Rights Reserved | |
// | |
var cz = exports; |
Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube
Also check out Minimal D3D11 pt2, reconfigured for instanced rendering and with a smaller, tighter, simplified overall code structure, or Minimal D3D11 pt3, with shadowmapping + showcasing a range of alternative setup and rendering techniques.
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU Library General Public License for more details. | |
# |
U can serve files in a gist with jslave using the gists ID/ilename
Example Gist: https://gist.github.com/hagb4rd/bf6f2b842a19d58179f58b46a5ae4660
Served via Jslave: https://jslave.herokuapp.com/gist/bf6f2b842a19d58179f58b46a5ae4660/index.html
EIGHT CIRCUIT MODEL OF CONSCIOUSNESS
this is still the most proper - analytic - decription .. won't beat the experiencing itself (or grimms fairy tales, but comes close) sorry it lost format, while copying.
Leary's
By Robert Anton Wilson