git clone https://gist.github.com/6780d7cc0cabb1b4d6c8.git
$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png
> offscreen-sample@1.0.0 start /Users/bsergean/src/offscreen_sample
Choose a ticket class: <select id="tickets"></select> | |
<p id="ticketOutput"></p> | |
<script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
{{if chosenTicket}} | |
You have chosen <b>${ chosenTicket().name }</b> | |
($${ chosenTicket().price }) | |
<button data-bind="click: resetTicket">Clear</button> | |
{{/if}} |
(function(knockout){ | |
var knockoutElementMapping = function(knockoutElement, dataElement) | |
{ | |
if(typeof(knockoutElement.mergeConstructor) == "undefined") | |
{ | |
if (!knockout.isComputed(knockoutElement)) | |
{ | |
if(knockoutElement.mergeMethod) | |
{ knockoutElement.mergeMethod(knockoutElement, dataElement); } |
define(['jquery', 'knockout', 'knockout.mapping', 'knockout.validation'], | |
function ($, ko) { | |
/** The module. */ | |
var self = {}; | |
/** The knockout view model. */ | |
self.viewModel = {}; | |
/** The knockout container. */ | |
self.container = null; |
//make a limited set of underscore functions transparently unwrap knockout observables | |
(function knockoutifyUnderscore(_) { | |
var unwrap = ko.utils.unwrapObservable; | |
//These can be shimed in a standard way | |
var koFriendly = ['map', 'filter', 'find', 'each', 'findBy', 'first', 'last', 'head', 'tail', 'union', 'compact', 'flatten', 'difference', 'without']; | |
var oldMap = _.map; | |
for (var _i = 0; _i < koFriendly.length; _i++) { | |
(function(fnName) { | |
var originalFn = _[fnName]; |
document.querySelectorAll = function(){ | |
var result = [].slice.call( HTMLDocument.prototype.querySelectorAll.apply(document, arguments ) ); | |
for(var i=0; i< frames.length; i++){ | |
try { | |
var doc = frames[i].document; | |
result = result.concat( [].slice.call( doc.querySelectorAll.apply(doc, arguments) ) ); | |
} catch(e){} | |
} | |
return result; |
""" | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. |
in vec2 v_texcoord; // texture coords | |
in vec3 v_normal; // normal | |
in vec3 v_binormal; // binormal (for TBN basis calc) | |
in vec3 v_pos; // pixel view space position | |
out vec4 color; | |
layout(std140) uniform Transforms | |
{ | |
mat4x4 world_matrix; // object's world position |
<!DOCTYPE html> | |
<html ng-app="test"> | |
<head> | |
<title>Performance Comparison for Knockout, Angular and React</title> | |
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet" /> | |
<style type="text/css"> | |
* { box-sizing:border-box; } | |
body { padding:30px 0; } | |
h2 { margin:0; margin-bottom:25px; } | |
h3 { margin:0; padding:0; margin-bottom:12px; } |
namespace Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |