Skip to content

Instantly share code, notes, and snippets.

View far-blue's full-sized avatar

Robert Goldsmith far-blue

View GitHub Profile
@far-blue
far-blue / type-r.change.Observable.html
Created July 2, 2017 22:35
Example extension of Type-R to support TC39 draft Observable interface specifically for change events and streaming only the changed properties.
<html>
<head>
<title></title>
</head>
<body>
<script src="most.js"></script>
<script src="type-r.js"></script>
<script>
// Support environments without Symbol support.
// ---------
@far-blue
far-blue / type-r.Observable.html
Created June 30, 2017 10:20
Example extension of Type-R (or even MixtureJS) to support a minimal TC39 compatible Observable interface.
<html>
<head>
<title></title>
</head>
<body>
<script src="most.js"></script>
<script src="type-r.js"></script>
<script>
// Support environments without Symbol support.
// ---------
@far-blue
far-blue / gist:1db4205adf1cbf18f732a6f2cf2e8b7e
Last active May 29, 2017 09:12
a concept for multiple bundles with sfx-core
/*
In order to load multiple bundles with sfx-core, how about wrapping each non-sfx bundling in the following:
*/
if (!window.hasOwnProperty('$_declares')) {
window.$_declares = [];
}
window.$_declares.push(function (System) {
// ** original bundle content here **
});
@far-blue
far-blue / ko.extend.observer.html
Last active June 29, 2017 09:59
ko observable extender to support Observable
<html>
<head>
<title></title>
</head>
<body>
<div id="app">
<input data-bind="textInput: x" class="x"> + <input data-bind="textInput: y" class="y"> = <span data-bind="text: result" class="result"></span>
</div>
<script src="most.js"></script>
[2016-07-29 10:33:06.000767] I [MSGID: 106163] [glusterd-handshake.c:1211:__glusterd_mgmt_hndsk_versions_ack] 0-management: using the op-version 30707
[2016-07-29 10:33:06.007010] I [MSGID: 106490] [glusterd-handler.c:2945:__glusterd_handle_probe_query] 0-glusterd: Received probe from uuid: 8a3f0112-9fad-4c9d-a1bc-4a7825953e88
[2016-07-29 10:33:06.008222] I [MSGID: 106129] [glusterd-handler.c:2980:__glusterd_handle_probe_query] 0-glusterd: Unable to find peerinfo for host: orca1.server.dev (24007)
[2016-07-29 10:33:06.011575] I [rpc-clnt.c:1004:rpc_clnt_connection_init] 0-management: setting frame-timeout to 600
[2016-07-29 10:33:06.012514] W [socket.c:984:__socket_keepalive] 0-socket: failed to set TCP_USER_TIMEOUT -1000 on socket 14, Invalid argument
[2016-07-29 10:33:06.012543] E [socket.c:3091:socket_connect] 0-management: Failed to set keep-alive: Invalid argument
[2016-07-29 10:33:06.012747] I [MSGID: 106498] [glusterd-handler.c:3589:glusterd_friend_add] 0-management: connect returned 0
[2016-07-29 10:3
@far-blue
far-blue / NetedTypesObservable.js
Created June 14, 2016 12:57
First attempt at creating a custom observable for Knockout to wrap a NestedTypes model instance attribute efficiently.
function modelAttributeObservable(model, attribute)
{
// Check the attribute exists
if (!(attribute in model)) {
throw new ReferenceError(attribute + ' is not an attribute of the supplied model');
}
// Setup the attribute observable cache
model._koObservables || (model._koObservables = {});
var OrderItemSet = Backbone.Collection.extend({
model: function(data, options)
{
var isAccountLevel = _.has(data._embedded.product, 'isAccountLevel')
&& data._embedded.product.isAccountLevel;
var subType = data.subType || null;
var orderItemFunction = OrderItem.factory(data.orderItemType, subType, isAccountLevel);
return new orderItemFunction(data, _.clone(options));
},
@far-blue
far-blue / gist:a7f3ecd3e1b823489aa8
Created July 16, 2015 09:35
composer conflict example
Project:
require: {
"wibble/a": "dev-feature",
"wibble/b": "dev-feature"
}
A:
require: {
"wibble/b": "dev-feature",
"wibble/c": ">=100"
@far-blue
far-blue / VBox.log
Created April 22, 2015 16:29
VBox.log from failed docker-machine create
VirtualBox VM 4.3.26 r98988 darwin.amd64 (Mar 16 2015 17:58:09) release log
00:00:00.031281 Log opened 2015-04-21T08:08:14.488683000Z
00:00:00.031282 Build Type: release
00:00:00.031293 OS Product: Darwin
00:00:00.031297 OS Release: 13.4.0
00:00:00.031301 OS Version: Darwin Kernel Version 13.4.0: Wed Dec 17 19:05:52 PST 2014; root:xnu-2422.115.10~1/RELEASE_X86_64
00:00:00.031427 DMI Product Name: MacBookAir5,1
00:00:00.031502 DMI Product Version: 1.0
00:00:00.031510 Host RAM: 8192MB total, 3093MB available
00:00:00.031512 Executable: /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless

Keybase proof

I hereby claim:

  • I am far-blue on github.
  • I am farblue (https://keybase.io/farblue) on keybase.
  • I have a public key whose fingerprint is 6D4D 1342 267A 17F6 F1CD 3ED2 0216 1C7E 2E92 F423

To claim this, I am signing this object: