Skip to content

Instantly share code, notes, and snippets.

View justengland's full-sized avatar

Justin England justengland

View GitHub Profile
@alinpopa
alinpopa / gist:1281448
Created October 12, 2011 15:05 — forked from vshkurin/gist:1109136
elasticsearch analyzer example - Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
@ciscoheat
ciscoheat / gist:3004119
Created June 27, 2012 13:40
Classes for mocking HttpContext in ASP.NET MVC with Moq.
using System.Collections.Generic;
using System.Security.Principal;
using System.Web;
using Moq;
namespace Tests.Utils
{
public class HttpContextMock
{
public HttpContextMock(IEnumerable<KeyValuePair<string, string>> requestParams)
git config --global diff.tool opendiff
git config --global difftool.opendiff.cmd 'opendiff "$LOCAL" "$REMOTE"'
git config --global merge.tool opendiff
git config --global mergetool.opendiff.cmd 'opendiff -merge "$MERGED" "$LOCAL" "$REMOTE"'
git config --global mergetool.opendiff.trustExitCode false
@fbrnc
fbrnc / cw_exp.js
Created March 4, 2016 06:29
AWS Lambda function that collects relevant metrics from CloudWatch and pushes them to ElasticSearch
var AWS = require('aws-sdk');
var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'});
exports.handler = function (event, context) {
var ElasticSearchHost = 'elasticsearch.example:9200';
var Environment = 'int';
var EndTime = new Date;
var StartTime = new Date(EndTime - 15*60*1000);
var Metrics = {
@Ioan-Popovici
Ioan-Popovici / Start-WindowsCleanup.ps1
Last active December 15, 2023 16:04
Performs a windows cleanup by removing volume caches, update backups, update and CCM caches.
<#
.SYNOPSIS
Performs a windows cleanup.
.DESCRIPTION
Performs a windows cleanup by removing volume caches, update backups, update and CCM caches.
.PARAMETER CleanupOptions
Supported options:
"comCacheRepair" # Component Cache Repair
"comCacheCleanup" # Component Cache Cleanup
"volCacheCleanup" # Volume Cache Cleanup
@f-bader
f-bader / Sync-TfsIdentity.ps1
Last active March 17, 2021 14:55 — forked from jstangroome/Sync-TfsIdentity.ps1
Force TFS 2018 to synchronize Active Directory group memberships
[CmdletBinding()]
param (
[Parameter(Mandatory=$true, Position=0)]
[uri]
$ServerUri
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active March 19, 2023 14:57
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'