Skip to content

Instantly share code, notes, and snippets.

@jpommerening
jpommerening / laxar-native.md
Created July 20, 2017 10:22
Evaluation: what's keeping us from using LaxarJS with something like React Native or Weex

Motivation

React Native and Weex are projects that employ a JavaScript runtime and virtual DOM implementation to control native UI elements (for example UIView instances in iOS rather than <div> elements). These projects enable programmers to use familiar concepts (unidirectional data flow, data binding) and technology (JavaScript, JSX, Vue-Components) to build native mobile apps.

With LaxarJS 2 we dropped many ties to the browser runtime (by dropping Angular JS, introducing adapters, almost pluggable routing) so we might, with some effort, be able to create native Apps with LaxarJS.

This would probably be a rather big project. Let's update this ticket (feel free to edit the description) to keep track of the progress and decisions we make along the way.

Technicalities

@jpommerening
jpommerening / content-bundle.js
Last active June 26, 2017 11:56
laxar-developer-tools-widget
const context = require.context('!!file-loader?context=' + __dirname + '/content/&name=devtools/[path][name].[ext]!./content/var/dist/', true, /\.(css|eof|js|png|svg|ttf|woff2?)(\.map)?$/);
const index = require('!!file-loader?context=' + __dirname + '/content/&name=devtools/[path][name].[ext]!./content/index.html');
const keys = context.keys();
module.exports = {
index: index,
scripts: keys.filter(file => (file.substr(-3) === '.js')).map(context),
styles: keys.filter(file => (file.substr(-4) === '.css')).map(context)
};
// @flow
declare class AxConfiguration {
get( key: string, default?: any ): any;
ensure( key: string ): any;
};
declare type AxContext = {
eventBus: AxEventBus;
features: AxFeatures;
@jpommerening
jpommerening / .babelrc
Last active April 26, 2017 15:26
Flow types for widgets
{
"presets": [
[ "es2015", { "modules": false } ],
[ "flow" ]
],
"plugins": [
"transform-object-rest-spread"
]
}
@jpommerening
jpommerening / .procmailrc
Created March 20, 2017 13:27
Some procmail patterns
LOGFILE=$HOME/procmail.log
VERBOSE=on
MAILDIR=/var/spool/imap/$LOGNAME
DEFAULT=./
TOP=.
SP=" "
SPC="[$SP]"
NSPC="[^$SP]"
@jpommerening
jpommerening / font-trace.js
Created September 27, 2016 09:59
svg letter tracing
const PHI = 1.6180339887498948;
const params = {
'font-size': 1,
'cap-height': 1,
'x-height': 1 / PHI,
'baseline': 0,
'ascender-height': 1.1,
'descender-height': 0.3,

Keybase proof

I hereby claim:

  • I am jpommerening on github.
  • I am svckr (https://keybase.io/svckr) on keybase.
  • I have a public key whose fingerprint is 963C 704B 80B2 EB67 7B3D 9264 4130 4D03 41D4 5A7C

To claim this, I am signing this object:

<style>
// Theming/Styling
.progress {
width: 100px;
height: 100px;
}
.progress .fill {
border: 8px solid orange;
width: calc(100% - 8px);
@jpommerening
jpommerening / lru.js
Created October 9, 2015 09:08
a minimal lru structure for js
/**
* Create dead-simple LRU structure.
* @param {Number} size maximum number of items to be stored.
* @param {Object} [init] initial contents.
* @return {Object} the LRU object
*/
function LRU( size, init ) {
var items = init || Object.create( null );
var keys = Object.keys( items );
@jpommerening
jpommerening / cssTransform.polyfill.js
Last active August 29, 2015 14:14
CSS transform polyfill (work in progress)
;(function(window, document, Math, undefined) {
var ORIGIN_PATTERN = /\s*(-?[0-9.]+)(%?)\s+(-?[0-9.]+)(%?)\s*/;
var TRANSFORM_PATTERNS = [
/(matrix)\(\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*\)/,
/(translate)\(\s*(-?[0-9.]+)\s*,\s*(-?[0-9.]+)\s*\)/,
/(rotate|skew[XY])\(\s*(-?[0-9.]+)(deg|g?rad|turn)\s*\)/,
/(scale)\(\s*(-?[0-9.]+)(%?)\s*(?:,\s*(-?[0-9.]+)(%?)\s*)\)/
];
var TRANSFORM_FUNCTIONS = {
matrix: function (v0, v1, v2, v3, dx, dy) {