Skip to content

Instantly share code, notes, and snippets.

View opichals's full-sized avatar

Standa Opichal opichals

  • Prague, Czech Republic
View GitHub Profile
@opichals
opichals / gist:9074197
Created February 18, 2014 16:23
ObjectProxy.unknownProperty definesProperty
var content = Em.Object.create({
x: 1,
y: 2,
z: 0
});
var op = Em.ObjectProxy.createWithMixins({
content: content,
yBinding: 'x',
@opichals
opichals / gist:9527732
Created March 13, 2014 12:42
Em.Logger...
+ Em.Logger.assert = function myAssert(test, message) {
+ if (!test) {
+ try {
+ throw new Error(message);
+ } catch(e) {
+ console.log('ASSERT LOG: '+e.message+e.trace);
+ } finally {
+ console.trace('ASSERT: '+message);
+ console.assert(test, 'ASSERT: '+message);
@opichals
opichals / sinon-useFakeTimers-to-avoid-touching-window-Date.js
Last active August 29, 2015 13:57
Mod to make sinon.useFakeTimers() compatible with Ember.js runloop
if (!sinon._originalUseFakeTimers) {
sinon._originalUseFakeTimers = sinon.useFakeTimers;
sinon.useFakeTimers = function() {
// make sure we don't override window.Date used in
// Backburner.setTimeout() to optimize window.setTimeout() call numbers
return sinon._originalUseFakeTimers.apply(this, [new Date().getTime(), "setTimeout", "setInterval", "clearTimeout", "clearInterval"]);
};
sinon._originalTest = sinon.test;
sinon.test = function(callback) {
@opichals
opichals / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../google-map/google-map-search.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
From a1a4f31f23c7c777c160a4631e4df777eaef2f79 Mon Sep 17 00:00:00 2001
From: Standa Opichal <opichals@gmail.com>
Date: Fri, 6 Aug 2010 14:22:39 +0200
Subject: [PATCH 2/2] Removing the 'cannot parse d=""' errors reported by browsers.
---
gfx/svg.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfx/svg.js b/gfx/svg.js
From 6ace654dac086185c8158e341887dd929c7c234a Mon Sep 17 00:00:00 2001
From: Standa Opichal <opichals@gmail.com>
Date: Fri, 6 Aug 2010 15:29:44 +0200
Subject: [PATCH 3/3] Avoid touching the s.rawNode internals in destroy() and rather keep the _nodeName in the dojox.gfx.Surface instance to remove the surfaces[] entry.
This avoid SL crashing in case the holding DOM node is not in the document or is hidden at the time in which case it would report invalidObject error.
---
gfx/silverlight.js | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
@opichals
opichals / a.js
Created January 12, 2011 09:21
npm link problem test
#!/usr/bin/env node
require('util').debug('A');
@opichals
opichals / run spark2
Created February 15, 2011 17:32
nodejs multi-node setup
spark2 -v -n 1 --port 3000 2>&1
@opichals
opichals / YUI3.3.0 tickets
Created February 23, 2011 11:59
YUI3.3.0 related tickets GoodData had to deal with
I am not the author of the tickets, but needed to work around these:
Widget destructor double node removal (got a patch from Satyen to mitigate)
http://yuilibrary.com/projects/yui3/ticket/2529860
UI_EVENTS - was IMO broken in earlier releases as well
http://yuilibrary.com/projects/yui3/ticket/2529723
HistoryHash in IE7 fix:
http://yuilibrary.com/projects/yui3/ticket/2529990
@opichals
opichals / README
Created January 4, 2012 08:51
Google Chrome Frame No Content on POST 204
https://gist.github.com/1559168
Reproduction stuff for POST resulting in 204 'No Content' on the server returns XMLHttpRequest result == 0.
The example uses YUI3, but it was verified that the result status of 0 comes from the XMLHttpRequest object status field.
* install nodejs
Download and install the appropriate package from nodejs.org
* install express (nodejs web stack)