This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Allows for drawing random pixels into a writeable bitmap | |
/// </summary> | |
public class PixelBuffer | |
{ | |
private WriteableBitmap _source; | |
private byte[] _pixels; | |
/// <summary> | |
/// Initializes a new instance of <see cref="PixelBuffer"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PUBLIC_IP=$(ip addr show eth0 | grep "inet" | awk 'NR == 1 { print $2 }' | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nl.fizzylogic.restservice | |
import akka.actor.{Actor, ActorRef, Props, ReceiveTimeout} | |
import org.json4s.DefaultFormats | |
import spray.httpx.Json4sSupport | |
import spray.http.{StatusCode, StatusCodes} | |
import spray.routing.{HttpService, RequestContext} | |
import scala.concurrent.duration._ | |
import scala.reflect.ClassTag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Weblog.Models; | |
using Nest; | |
using Polly; | |
namespace Weblog.Services | |
{ | |
public class PostIndexer: IPostIndexer | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Clients | |
{ | |
public static IEnumerable<Client> All => new[] | |
{ | |
new Client() | |
{ | |
AccessTokenType = AccessTokenType.Jwt, | |
ClientId = "9c328f06-01c7-4429-9870-7e55a73e2870", | |
RedirectUris = new List<string> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$internetSettings = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"; | |
# Determines the current state of the proxy | |
function Get-ProxyState() { | |
$settings = Get-ItemProperty -Path $internetSettings; | |
return $settings.ProxyEnable; | |
} | |
# Enables the proxy. | |
# IMPORTANT: Change the defaults to something that is useful to you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type MappingRule = (data: any) => any; | |
export type MappingRules<T> = { [P in keyof T]?: MappingRule }; | |
export type MapperFunction<T> = (input: T) => any; | |
// Maps property values based on rules that you supplied. | |
// Properties for which no rule was supplied are copied to the output. | |
// NOTICE: This mapper function does not support renaming properties. | |
export function mapObject<T>(input: T, rules: MappingRules<T>): any { | |
if(input === undefined || input === null) { | |
return input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApiRequestOptions } from './api-request-options.service'; | |
import { Http, Response, RequestOptions, ResponseContentType } from '@angular/http'; | |
import 'rxjs/add/observable/zip'; | |
import 'rxjs/add/operator/map'; | |
import { Observable } from 'rxjs/Rx'; | |
import { Injectable } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
@Injectable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Renders email content based on razor templates | |
/// </summary> | |
public interface ITemplateService | |
{ | |
/// <summary> | |
/// Renders a template given the provided view model | |
/// </summary> | |
/// <typeparam name="TViewModel"></typeparam> | |
/// <param name="filename">Filename of the template to render</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SUBSCRIPTION=$1 | |
ENVIRONMENT=$2 | |
az group create --name kubernetes-$ENVIRONMENT --location westeurope | |
az acs create --orchestrator-type kubernetes \ | |
--resource-group kubernetes-$ENVIRONMENT \ | |
--name $ENVIRONMENT \ | |
--generate-ssh-keys \ |
OlderNewer