Skip to content

Instantly share code, notes, and snippets.

Jef Statham JefStat

  • Solink
  • Ottawa
Block or report user

Report or block JefStat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JefStat
JefStat / MoqExtensions.cs
Created May 7, 2018 — forked from 7Pass/MoqExtensions.cs
Extension methods to quickly ignore arguments without repeating It.IsAny<>()
View MoqExtensions.cs
using System;
using System.Linq.Expressions;
using Moq.Language.Flow;
namespace Moq
{
public static class MoqExtensions
{
public static ISetup<T, TResult> SetupIgnoreArgs<T, TResult>(this Mock<T> mock,
Expression<Func<T, TResult>> expression)
@JefStat
JefStat / sumo_logic.config
Last active Feb 14, 2018
Elastic Beanstalk Sumo Logic Config
View sumo_logic.config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# To add or remove tracked files, simply add or remove source hashes to the
# sources array.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
sysvinit:
View log.txt
provider.aws - *terraform.graphNodeResourceDestroy
aws_api_gateway_rest_api.Hello - *terraform.GraphNodeConfigResource
aws_api_gateway_rest_api.Hello (destroy tainted) - *terraform.graphNodeProvider
aws_api_gateway_rest_api.Hello (destroy) - *terraform.graphNodeResourceDestroy
provider.aws - *terraform.graphNodeResourceDestroy
aws_api_gateway_rest_api.Hello (destroy tainted) - *terraform.graphNodeResourceDestroy
aws_api_gateway_deployment.dev (destroy tainted) - *terraform.graphNodeProvider
aws_api_gateway_deployment.int (destroy tainted) - *terraform.graphNodeResourceDestroy
aws_api_gateway_integration.HelloGet (destroy tainted) - *terraform.graphNodeResourceDestroy
aws_api_gateway_integration.HelloOptions (destroy tainted) - *terraform.graphNodeResourceDestroy
@JefStat
JefStat / api-gateway.tf
Created May 3, 2016
cannot create a wildcard lambda function
View api-gateway.tf
variable "function_hello" {}
resource "aws_api_gateway_rest_api" "Hello" {
name = "Hello World API"
description = "Terraform integration"
}
resource "aws_api_gateway_resource" "Hello" {
rest_api_id = "${aws_api_gateway_rest_api.Hello.id}"
parent_id = "${aws_api_gateway_rest_api.Hello.root_resource_id}"
View gist:9eca9815630d2c0fff90a313da94b180
module.iam.output.lambda_function_role_id - *terraform.GraphNodeConfigResourceFlat
provider.aws - *terraform.graphNodeProvider
root - terraform.graphNodeRoot
module.iam.aws_iam_role.Fake_POS - *terraform.GraphNodeConfigResourceFlat
module.iam.aws_iam_role.gateway_invoke_lambda - *terraform.GraphNodeConfigOutputFlat
module.iam.aws_iam_role_policy.invoke_lambda - *terraform.GraphNodeConfigResourceFlat
module.iam.aws_iam_role_policy.oneClick_lambda_basic_execution_1454641427156 - *terraform.GraphNodeConfigOutputFlat
module.iam.output.api_gateway_role_arn - *terraform.GraphNodeConfigResourceFlat
module.iam.output.lambda_function_role_id - *terraform.GraphNodeConfigResourceFlat
var.apex_function_hello - *terraform.GraphNodeConfigVariable
@JefStat
JefStat / Terraform api gateway bug
Created May 3, 2016
Terraform api gateway bug sample
View Terraform api gateway bug
variable "function_hello" {}
resource "aws_api_gateway_rest_api" "Hello" {
name = "Hello World API"
description = "Terraform integration"
}
resource "aws_api_gateway_resource" "Hello" {
rest_api_id = "${aws_api_gateway_rest_api.Hello.id}"
parent_id = "${aws_api_gateway_rest_api.Hello.root_resource_id}"
View MSbuildVerbosityLevel
<PropertyGroup>
<CommandLine>$([System.Environment]::CommandLine.Trim().ToLower())</CommandLine>
<IsQuietVerbosity>False</IsQuietVerbosity>
<IsMinimalVerbosity>False</IsMinimalVerbosity>
<IsNormalVerbosity>True</IsNormalVerbosity>
<IsDetailedVerbosity>False</IsDetailedVerbosity>
<IsDiagnosticVerbosity>False</IsDiagnosticVerbosity>
</PropertyGroup>
<PropertyGroup Condition="'$(CommandLine.Contains(&quot;/v&quot;))' == 'True'">
View gist:3da7ea8f5cc00d246f0f
public class PollingService
{
private Thread _workerThread;
private AutoResetEvent _finished;
private const int _timeout = 60*1000;
private readonly Queue<Work> _queue = new Queue<Work>();
public void StartPolling()
{
@JefStat
JefStat / getCurrentMethodName.java
Created Aug 1, 2013
getCurrentMethodName (wasn't quite working might need it to be static)
View getCurrentMethodName.java
private static int getStackTraceIndexForObject(final Object object)
{
// Finds out the index of "this code" in the returned stack trace - funny but it differs in JDK 1.5 and 1.6
int i = 0;
for (final StackTraceElement ste : Thread.currentThread().getStackTrace()) {
++i;
if (ste.getClassName().equals(object.getClass().getName())) {
break;
}
}
You can’t perform that action at this time.