Skip to content

Instantly share code, notes, and snippets.

View abombss's full-sized avatar

Adam Tybor abombss

  • Accenture
  • Chicago, IL
View GitHub Profile
@abombss
abombss / SumoApi.ps1
Created November 26, 2014 17:39
SumoLogic Powershell API
<#
The MIT License (MIT)
Copyright (c) 2014 Adam Tybor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@abombss
abombss / FailedRequestHeaderParser.txt
Last active August 29, 2015 14:28
Sumologic parsing expressions for IIS Failed Request Tracing logs
"<failedRequest "
| kv regex "=\"([^\"]*)\""
keys "url"
, "siteId"
, "appPoolId"
, "processId"
, "verb"
, "remoteUserName"
, "userName"
, "tokenUserName"
@abombss
abombss / Get-AzureRmResourceReference.ps1
Last active September 22, 2015 18:33
Get Available Azure Resource Manager Schemas
function Get-AzureRmResourceReference {
[CmdletBinding(DefaultParameterSetName='Version')]
param(
[Parameter(Mandatory=$false, Position=0, ParameterSetName='Version')]
[string]$Version='2015-01-01',
[Parameter(Mandatory=$true, Position=0, ParameterSetName='Uri')]
[uri]$Uri,
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ParameterSetName='Content')]
package roboguice.astroboy;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import roboguice.inject.InjectView;
import java.util.List;
@abombss
abombss / ContextRunner.java
Created February 5, 2011 07:39
Poor Man's Mspec in Java
public class ContextRunner extends Runner {
static class SpecificationMethod {
Class<?> TestContainerType;
Description TestContainerDescription;
ContextSpecification ContextSpecification;
Description ContextSpecificationDescription;
Field ContextSpecificationField;
Method SpecificationMethod;
Description SpecificationDescription;
}
@abombss
abombss / RobolectricGuicyTestRunner.java
Created February 9, 2011 05:44
Robolectric test runner with modifications for RoboGuice 1.2-SNAPSHOT
public class RobolectricGuicyTestRunner extends RobolectricTestRunner {
public RobolectricGuicyTestRunner(Class testClass) throws InitializationError {
super(testClass, new File("./application").exists() ? new File("./application") : new File("./"));
}
@Override
protected Application createApplication() {
Application app = super.createApplication();
Injector injector = RoboGuice.getInjector(Stage.PRODUCTION, app,new RoboModule(app), new RobolectricModule());
return app;
@abombss
abombss / WakefulIntentService.java
Created February 21, 2011 18:02
A compatible wakeful intent service
/***
Copyright (c) 2009 CommonsWare, LLC
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@abombss
abombss / gist:937804
Created April 22, 2011 22:13
Fugly mvc
var model = new
{
Accounts = accounts.Select(x => x.ToExpando()),
TotalUsers = totalUsers,
Page = page,
};
return View(model.ToExpando());
@abombss
abombss / CQRS.cs
Created June 4, 2011 05:15 — forked from ToJans/CQRS.cs
Simple concept code to show how CQRS works
//---><8--------------------------- UI loads viewmodels and generates commands ----
UI.Viewmodel = ViewModelStore.Query(UI.SomeParameters);
UI.HandleInput = GeneratedCommand => CommandStore.Add(GeneratedCommand);
//---><8--------------------------- Commands to events -----------------------------------------
// This uses an iterator because a command should only be handled once
while(CommandStore.HasCommands)
@abombss
abombss / jquery-iebuttonfix.js
Created June 15, 2011 07:28
JQuery plugin to fix the html <button> issue when submitting forms in IE <= 7
(function ($) {
/// <param name="$" type="jQuery">JQuery</param>
$.fn.iebuttonfix = function() {
return $(this).each( function() {
var $f = $(this);
if ($f.prop("nodeName").toLowerCase() === "form") {
$f.submit(function() {
$("button", $f).each(function() {
var $b = $(this);
if ($b.data("ie.btnfix.clicked")) {