Skip to content

Instantly share code, notes, and snippets.

View jarek-foksa's full-sized avatar

Jarek Foksa jarek-foksa

View GitHub Profile
let compileScript = (content, relPath) => {
let Compiler = traceur.syntax.Compiler;
let Options = traceur.util.Options;
let options = new Options(traceur.Compiler.prototype.defaultOptions);
options.setFromObject({
arrayComprehension: true,
asyncFunctions: true,
asyncGenerators: true,
forOn: true,
let compileScript = (content, relPath) => {
let Compiler = traceur.syntax.Compiler;
let Options = traceur.util.Options;
let options = new Options(traceur.Compiler.prototype.defaultOptions);
options.setFromObject({
arrayComprehension: true,
asyncFunctions: true,
asyncGenerators: true,
forOn: true,
// @copyright
// © 2015 Jarosław Foksa
import {createElement} from "../utils/dom";
import {round, sin, cos, degToRad, PI} from "../utils/math";
import {collapseWhitespace} from "../utils/string";
const STAR_PATH_DATA_ATTRIBUTES = [
"data-bx-cx",
/*
* @copyright
* © 2012-2015 Jarosław Foksa
*/
:host {
width: 100px;
height: 35px;
display: block;
// @copyright
// © 2012-2015 Jarosław Foksa
import {registerElement} from "../utils/dom";
import {normalize} from "../utils/math";
const DEBUG = false;
const INNER_HTML = `
// @src
// https://github.com/GoogleChrome/chrome-app-samples/tree/master/one-time-payment
// @output
// "FULL" - Fully paid & properly licensed
// "FREE_TRIAL" - Free trial, still within trial period
// "FREE_TRIAL_EXPIRED" - Free trial, trial period expired
// "NONE" - No license ever issued
var getLicense = function(callback) {
var retry = true;
var access_token = null

In order to improve the (re)load time of Safari Web Inspector you have to modify /System/Library/PrivateFrameworks/WebInspectorUI.framework/Versions/A/Resources/Main.js file.

Comment or remove the following three lines (TimelineManager.js in the unminified source):

WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._startAutoRecording, this);
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);

Reimplement WebInspector.dispatchMessageFromBackend method (Main.js in the unminified source) as follows:

@jarek-foksa
jarek-foksa / gist:831284c74d64e1b6be69
Created January 16, 2015 04:20
Workaround for Chrome bug #333868
/**********************************************************************************************
Workaround for Chrome bug #333868 which breaks "mouseenter" and "mouseleave" events.
*********************************************************************************************/
(function() {
var $addEventListener = EventTarget.prototype.addEventListener;
var $removeEventListener = EventTarget.prototype.removeEventListener;
const MOUSEENTER_TO_MOUSEOVER_SYM = Symbol();
const MOUSELEAVE_TO_MOUSEOUT_SYM = Symbol();
export default class EventEmitter {
// @type
// (string, Function) => void
addEventListener(eventName, listener) {
if (!this._events) {
this._events = {};
}
let listeners = this._events[eventName];
var Button = document.registerElement("x-button", { prototype: {
__proto__: HTMLElement.prototype,
// @info
// Fired immediately after the host element is created
createdCallback: function() {
this.createShadowRoot();
this.shadowRoot.innerHTML =
'<div id="button"> ' +