Skip to content

Instantly share code, notes, and snippets.

View PeterAronZentai's full-sized avatar

Peter Aron Zentai PeterAronZentai

View GitHub Profile
@PeterAronZentai
PeterAronZentai / sharepoint.js
Created June 6, 2012 16:21
JayData context for a Sharepoint metadata
////////////////////////////////////////////////////////////////////////////////////////
////// Autogenerated by JaySvcUtil.exe http://JayData.org for more info /////////
////// oData v1 /////////
////////////////////////////////////////////////////////////////////////////////////////
(function(global, $data, undefined) {
@PeterAronZentai
PeterAronZentai / jayclassmixin.js
Created July 21, 2012 07:09
JayData Class definition with mixin types
$data.Class.define("Types.A", null, null, {
});
$data.Class.define("Types.B", null, null, {
});
$data.Class.define("Types.C", [Types.A, Type.B], null, { });
//the last line throws an error complaining about only object can be the arguments deep down in the construction process
@PeterAronZentai
PeterAronZentai / gist:3169414
Created July 24, 2012 11:08
using promises with Q
var q = require('q');
function doSomething(a, b) {
var defer = q.defer();
return q.fcall( function() { return [a,b]});
///
{
"photos": {
"items": [
{
"id":1,
"class":"Photo",
"caption":"Photo about the 120 year old facade",
"alternative":"image of the building",
"image": "{{runtime reference to a variant}}",
"variants": {
// node+v8: 250ms
// chrome+v8: 5500ms
// edge+chakra: 3400ms
// node+chakra: ?????
var count = 1000;
var tests = 1000;
var items = [];
export class LogViewer extends React.Component<any, any> {
// some parts are omitted for brevity, like store subscription, or the actions
public defaultPresenter = ({message}) => <div>{message}</div>
public render() { return (
<ul>
<li>
{logStore.items.map( m => {
const P = m.presenter || this.defaultPresenter
return <P key={m.id} {...m} />