Presented at Front Conference Zurich 31 August - 1 September 2017
Video at https://vimeo.com/232221648
var ponies = [
| //META{"name":"SimpleDiscordCrypt","source":"https://github.com/Scoder12/RepoTBD","website":"https://scoder12.ml","authorId":"339943808584384512"}*// | |
| /*@cc_on | |
| @if (@_jscript) | |
| var shell = WScript.CreateObject("WScript.Shell"); | |
| var fs = new ActiveXObject("Scripting.FileSystemObject"); | |
| var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins"); | |
| var pathSelf = WScript.ScriptFullName; | |
| shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30); | |
| if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) { |
| function useState(value) { | |
| const {caller} = arguments.callee; | |
| const {arguments: a} = caller; | |
| const {stack} = useState; | |
| if (!stack.has(caller)) | |
| stack.set(caller, {a, i: 0, s: []}); | |
| const state = stack.get(caller); | |
| state.a = a; | |
| const {i, s} = state; | |
| if (i === s.length) { |
Presented at Front Conference Zurich 31 August - 1 September 2017
Video at https://vimeo.com/232221648
var ponies = [
This is some sort of answer to recent posts regarding Web Components, where more than a few misconceptions were delivered as fact.
Let's start by defining what we are talking about.
As you can read in the dedicated GitHub page, Web Components is a group of features, where each feature works already by itself, and it doesn't need other features of the group to be already usable, or useful.
| /* | |
| To Compile: | |
| PATH\\TO\\jsc.exe QueryDotnet.js | |
| This example is based on: | |
| https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed | |
| */ | |
| import System; | |
| import Microsoft.Win32; |
| // now an npm package qith 100% code coverage: | |
| // https://github.com/WebReflection/endow#endow--- | |
| // (c) Andrea Giammarchi, @WebReflection (ISC) | |
| const mix = Super => ({ | |
| with: (...mixins) => | |
| mixins.reduce( | |
| (Class, Mixin) => { | |
| Class = Mixin(Class); | |
| if (!Mixin.hasOwnProperty(Symbol.hasInstance)) { |
| /* | |
| This code snippet demonstrates how to do metaprogramming | |
| in JavaScript using proxy and with statement. | |
| Run this in non-strict mode. | |
| */ | |
| const proxy = new Proxy({}, { | |
| get(target, key) { | |
| if(key === Symbol.unscopables) return {} | |
| return `${key.toUpperCase()} ` | |
| }, |
| function extensible(object) { | |
| // usable to extend a class | |
| function descriptors() {} | |
| // get rid of name, length, and the rest | |
| Reflect.ownKeys(descriptors).forEach(function (k) { | |
| delete descriptors[k]; | |
| }); | |
| // clean up the constructor too | |
| descriptors.prototype = {}; | |
| // per each property in object |
| var withSuperContext = (function (Object) { | |
| //! (c) Andrea Giammarchi | |
| var | |
| defineProperty = Object.defineProperty, | |
| getPrototypeOf = Object.getPrototypeOf, | |
| setPrototypeOf = Object.setPrototypeOf || | |
| function (o, p) { o.__proto__ = p; }, | |
| handler = { | |
| get: function get(target, property, receiver) { | |
| return function () { |
| /*! (c) 2016 Andrea Giammarchi - MIT Style License */ | |
| // simple state-like objects handler | |
| // based on prototypal inheritance | |
| function State() {'use strict';} | |
| // States are serializable dictionaries | |
| // toJSON and toString are the only reserved keywords | |
| // every other name can be used as name (included __proto__) |