Skip to content

Instantly share code, notes, and snippets.

View mtho11's full-sized avatar

Mike Thompson mtho11

  • Red Hat, Inc. (http://developers.redhat.com)
  • Klamath Falls, Oregon
View GitHub Profile
@mtho11
mtho11 / gist:8810921
Created February 4, 2014 19:46
GWT Javascript Error
[ERROR] Tue Feb 04 11:43:12 PST 2014
[ERROR] SEVERE: At [Tue Feb 04 11:43:12 PST 2014] MessageCenter received: Globally uncaught exception
[INFO] Tue Feb 04 11:43:12 PST 2014
[INFO] WARNING: Globally uncaught exception
[INFO] com.google.gwt.core.client.JavaScriptException: (TypeError): n is undefined
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
[INFO] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
[INFO] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
@mtho11
mtho11 / whyTypescript
Last active August 29, 2015 14:06
Why Typescript?
# Why Typescript?
### 10 Reasons to start using Typescript now
1) Typescript is opensource. Yes, Microsoft created it, but you can fork the source on [github](https://github.com/Microsoft/TypeScript)
2) Start using the next version of javascript—>ES6, today in fairly mature 1.1+ version language. The ES6 language adds features such as modules and classes. Typescript will track the emerging ES6 standard and add those features as they become solid.
3) Typescript is a superscript of javascript so you can begin to use it incrementally. The first step can be to change *.js to *.ts and immediately see the benefits of some internal type checking.
@mtho11
mtho11 / standalone.xsl
Created July 27, 2015 19:44
Valid Metrics for Hawkular
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@mtho11
mtho11 / gist:4354099
Created December 21, 2012 17:05
Nice impl of functional list methods from Haskell, but in Java 1.8.
package haskell.data;
import java.util.*;
import java.util.functions.*;
import haskell.data.functions.*;
import java.io.*;
/**
@mtho11
mtho11 / Table.java
Last active December 16, 2015 07:19
SmartGWT 3.0p SortSpecifier Bug
/*
* RHQ Management Platform
* Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* 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 version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
@mtho11
mtho11 / gist:6820073
Created October 4, 2013 02:26
Cassandra EE7 Sample
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
Hawkular Root Cause Analysis
NOTE: This process is NOT about identifying faults in people, the goal of this (and all) RCA is to identify oportunities to improve our team processes.
BlueJeans: https://redhat.bluejeans.com/1826343252
Stated issue: URLs always in Down state
http://livingontheedge.hawkular.org/hawkular-ui/url/url-list
Where issue was encountered: LOTE
Reported by: Upstream Community
'use strict';
// from file: manageiq/spec/javascripts/services/middleware_add_datasource_service_spec.js
// https://github.com/mtho11/manageiq/blob/3b19676bf461a974946f0fffa8914612dc2568ef/spec/javascripts/services/middleware_add_datasource_service_spec.js#L29-L29
describe('mwAddDataSourceService', function () {
var mwAddDataSourceService, httpMock, $http;
beforeEach(module('ManageIQ'),function($provide, _$http_){
$http = _$http_;
@mtho11
mtho11 / gist:7004d203b1f9c84ec826c0e868ec86c3
Created December 15, 2016 19:17
Rx.js RateLimitOperator
//noprotect
console.clear();
const { Observable, Subject, Subscriber, Scheduler } = Rx;
function rateLimit(budget, time, shouldBuffer = false, scheduler = Scheduler.async) {
return this.lift(new RateLimitOperator(budget, time, shouldBuffer, scheduler));
}
class RateLimitOperator {
var datasources = [
{id: 'H2', label: 'H2', name: 'H2DS', jndiName: 'java:jboss/datasources/H2DS',
driverName: 'h2', driverModuleName: 'com.h2database.h2', driverClass: 'org.h2.Driver',
connectionUrl: ':mem:test;DB_CLOSE_DELAY=-1'},
{id: 'POSTGRES', label: 'Postgres', name: 'PostgresDS', jndiName: 'java:jboss/datasources/PostgresDS',
driverName: 'postgresql', driverModuleName: 'org.postgresql', driverClass: 'org.postgresql.Driver',
connectionUrl: '://localhost:5432/postgresdb', alias: 'POSTGRESQL'},
{id: 'MSSQL', label: 'Microsoft SQL Server', name: 'MSSQLDS', jndiName: 'java:jboss/datasources/MSSQLDS',
driverName: 'sqlserver', driverModuleName: 'com.microsoft',
driverClass: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',