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
@rikkit
rikkit / package.json.example
Last active February 17, 2024 04:43
Rollup + TypeScript + source maps + .d.ts files
{
...
"source": "src/index.ts",
"main": "dist/main.cjs",
"module": "dist/module.mjs",
"types": "dist/index.d.ts",
"scripts": {
"dev": "rollup -w -c",
"build": "rollup -c",
"prepack": "yarn run build",
@rikkit
rikkit / gist.js
Last active January 16, 2019 21:43
Remove unavailable tickets from RWC 2019 tickets page - run it twice
// remove unavailable
_.values($(".priceItem"))
.filter(item => item.lastElementChild && item.lastElementChild.innerText == "Currently Unavailable")
.forEach(item => item.remove());
// remove wheelchair tickets
_.values($(".priceItem"))
.filter(item => item.firstElementChild && item.firstElementChild.innerText.indexOf("WHEELCHAIR") > -1)
.forEach(item => item.remove())
@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;
@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 / 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 / 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 / query
Created May 20, 2015 08:59
highlight query
POST applicationlogs/logentries/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"exception": "infomercial"
}
}
POST /index/type/_search
{
"query": {
"filtered": {
"filter": {
"term": {
"body": process.argv[2]
}
}
}
@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
@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++)
{