Skip to content

Instantly share code, notes, and snippets.

View rikkit's full-sized avatar
🌍
Working from home

Rikki Tooley rikkit

🌍
Working from home
View GitHub Profile
// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.30729.1
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.30319
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
@rikkit
rikkit / GravatarWinRT.cs
Created March 31, 2013 22:14
Simple class to get a a Gravatar URI in WinRT
using System;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
namespace IF.Utilities.Common
{
public class Gravatar
{
private const string GravatarFormatString = "http://www.gravatar.com/avatar/{0}.jpg?d=retro&r=g&s={1}";
@rikkit
rikkit / gist:5311712
Created April 4, 2013 16:06
Get the scrollviewer of a WinRT ListView
public static ScrollViewer GetScrollViewer(DependencyObject o)
{
// Return the DependencyObject if it is a ScrollViewer
if (o is ScrollViewer)
{
return o as ScrollViewer;
}
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(o); i++)
{
@rikkit
rikkit / boxstarter.ps1
Last active August 29, 2015 14:05
Boxstarter script
#####
# START http://boxstarter.org/package/url?https://gist.github.com/rikkit/1c994ef5a8f549216b3d
#####
# update windows
Install-WindowsUpdate -AcceptEula
# windows features
cinst Microsoft-Hyper-V-All -source windowsFeatures
POST /index/type/_search
{
"query": {
"filtered": {
"filter": {
"term": {
"body": process.argv[2]
}
}
}
@rikkit
rikkit / query
Created May 20, 2015 08:59
highlight query
POST applicationlogs/logentries/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"exception": "infomercial"
}
}
@rikkit
rikkit / TestNancyContainer.cs
Last active August 29, 2015 14:21
Self host Nancy for an integration test
using Nancy;
using Nancy.Extensions;
using Nancy.Responses;
using Nancy.Hosting.Self;
using Nancy.TinyIoc;
using Nancy.Bootstrapper;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
@rikkit
rikkit / delete-by-query.ps1
Created September 3, 2015 13:22
delete items
# Delete items using a query
#
# -------------
$eshost = "http://LONAPP101.uklive.exabre.co.uk:50402"
$index = "live_20_34_item"
$type = "statiogn"
$query = '
{
"fields": [],
@rikkit
rikkit / BulkNestPublisher.cs
Created December 21, 2015 12:04
Bulk Nest Publisher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Nest;
using TheFilter.Core.Entity.Customers.Managers;
@rikkit
rikkit / BulkNestSearcher.cs
Created December 21, 2015 12:28
Nest Bulk Searcher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading;
using System.Threading.Tasks;
using Nest;
using _____.Managers;