First, an exercise. Can we represent all of css with plain data? Let's try.
let redText = { color: 'red' };| #!/usr/bin/env python | |
| """ | |
| animatronic_mouth.py | |
| This script animates a motorized mouth on a Raspberry Pi GPIO pin so that it | |
| appears to be speaking alongside the audio on the specified PulseAudio source | |
| (which usually should be a sink's monitor). | |
| Find PA_SOURCE with `pactl list` and look for a monitor device that corresponds |
| window.onerror = function (message, url, lineNo, colNo, error) { | |
| console.log(arguments); | |
| let container = document.createElement('div'); | |
| container.style.color = 'red'; | |
| container.style.position = 'fixed'; | |
| container.style.background = '#eee'; | |
| container.style.padding = '2em'; |
| /** | |
| * Get path data for a rounded rectangle. Allows for different radius on each corner. | |
| * @param {Number} w Width of rounded rectangle | |
| * @param {Number} h Height of rounded rectangle | |
| * @param {Number} tlr Top left corner radius | |
| * @param {Number} trr Top right corner radius | |
| * @param {Number} brr Bottom right corner radius | |
| * @param {Number} blr Bottom left corner radius | |
| * @return {String} Rounded rectangle SVG path data | |
| */ |
| var selector = 'img' // Replace this with the selector for the element you want to make transformable | |
| jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() { | |
| jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() { | |
| (function() { | |
| var $, applyTransform, getTransform, makeTransformable; | |
| $ = jQuery; |
| (function(def){ | |
| def('myModule', ['someDependency', 'somethingElse'], function(someDependency, somethingElse){ | |
| //return the module's API | |
| return {}; | |
| }); | |
| }( | |
| // wrapper to run code everywhere | |
| typeof define === 'function' && define.amd? |