Skip to content

Instantly share code, notes, and snippets.

@WinstonFassett
WinstonFassett / KOBindings.js
Created June 12, 2012 20:58
Common Knockout Bindings
// from https://github.com/SteveSanderson/knockout/wiki/Bindings---class
// addresses https://github.com/SteveSanderson/knockout/issues/233
// be careful of using the attr binding -- it has issues with iOS and quotes
// instead, use this to bind to the class attribute
ko.bindingHandlers['class'] = {
'update': function (element, valueAccessor) {
if (element['__ko__previousClassValue__']) {
$(element).removeClass(element['__ko__previousClassValue__']);
}
var value = ko.utils.unwrapObservable(valueAccessor());
@WinstonFassett
WinstonFassett / HideMobileAddressBar.js
Created July 31, 2012 01:39 — forked from mhammonds/HideMobileAddressBar.js
Hide Browser Address Bar - Android + iPhone
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
@WinstonFassett
WinstonFassett / knockout-jquery-ui-widget.js
Created August 13, 2012 21:25 — forked from medmunds/knockout-jquery-ui-widget.js
Knockout binding for jQuery.ui.widget
// knockout-jquery-ui-widget.js
// Copyright (c) 2011, Planapple, Inc.
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
//
// Knockout binding for jQuery UI widgets
//
// Examples:
// <input type="submit" value="OK" data-bind='jqueryui: "button"' />
//
// Attaches a jQuery UI button widget to this button, with default options.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: none; }
@WinstonFassett
WinstonFassett / index.html
Last active December 15, 2015 18:29 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
float: left;
border: solid 1px #aaa;
}
</style>
@WinstonFassett
WinstonFassett / index.html
Last active December 15, 2015 18:29 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
float: left;
border: solid 1px #aaa;
}
</style>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="http://cdn.quilljs.com/1.2.4/quill.snow.css" rel="stylesheet">
<link href="http://cdn.quilljs.com/1.2.4/quill.bubble.css" rel="stylesheet">
<style id="jsbin-css">
@WinstonFassett
WinstonFassett / SketchSystems.spec
Created January 5, 2020 18:08
Online-First Realtime Doc Viewer
Online-First Realtime Doc Viewer
restart -> Loading
Loading
Connecting to Remote Doc
disconnect while loading -> Load Failed
Preparing Auth
Identifying User
got user token -> Verifying User
no user token -> Login
Doc Viewer&
Mode
No Mode Set
Local Only
Remote Only
Local and Remote*&
go local only -> Local Only
go remote only -> Remote Only
Doc Viewer&
Mode
No Mode Set
Local Only
Remote Only
Local and Remote*&
go local only -> Local Only
go remote only -> Remote Only