Skip to content

Instantly share code, notes, and snippets.

@ChrisMcKee
ChrisMcKee / PredicatableGuid.cs
Last active April 19, 2024 08:49
Namespaced Deterministic Guid - RFC 4122 dotnetcore
using System;
using System.Security.Cryptography;
using System.Text;
namespace Utility
{
/// <summary>
/// Helper methods for working with <see cref="Guid"/>.
/// </summary>
public static class GuidUtility
@ChrisMcKee
ChrisMcKee / install_elasticsearch_on_ubuntu.sh
Created February 13, 2017 22:38 — forked from fxp/install_elasticsearch_on_ubuntu.sh
Install Elasticsearch on Ubuntu
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/5.x-prerelease/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get update
sudo apt-get install elasticsearch
service elasticsearch start
# if service start failed, try to modify -Xms lower like -Xms1g in /etc/elasticsearch/jvm.options
@ChrisMcKee
ChrisMcKee / Client.cs
Created March 29, 2016 15:18 — forked from prabirshrestha/Client.cs
Batch Request in nancy
using System.Net.Http;
class Program
{
static void Main(string[] args)
{
var client = new HttpClient();
var batchRequest = new HttpRequestMessage(HttpMethod.Post, "http://localhost:3440/api/batch");
using System;
using System.Collections.Generic;
using Tweetinvi;
using Tweetinvi.Core.Interfaces;
//https://dev.twitter.com/rest/reference/get/favorites/list
namespace Twatter
{
internal class Program
{
private static readonly List<ITweet> tweets = new List<ITweet>();
using System;
using System.Security.Cryptography;
using System.Text;
namespace Utility
{
/// <summary>
/// Helper methods for working with <see cref="Guid"/>.
/// </summary>
#!/bin/bash
echo '
###
# Welcome to graphite creator
###
!!!
! THIS WILL REMOVE /var/www - MAKE SURE YOU WANT TO DO THIS!
!!!
<#@ template language="C#" hostspecific="true" debug="True" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ import namespace="System" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
@ChrisMcKee
ChrisMcKee / Channon.sh
Created November 17, 2014 15:29
Channon
#!/usr/bin/env bash
NOW=$( date '+%Y-%m-%d_%H-%M-%S' )
FILE="$NOW.txt"
touch ~/$FILE
PUT /blurays
{
"settings": {
"analysis": {
"filter": {
"nGram_filter": {
"type": "nGram",
"min_gram": 2,
"max_gram": 20,
"token_chars": [