Skip to content

Instantly share code, notes, and snippets.

@Layoric
Layoric / main.cs
Created August 25, 2016 03:15
Initializing your Redis connection.
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
public class GithubRepository
{
public string Name { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public string Homepage { get; set; }
@Layoric
Layoric / index.md
Last active August 25, 2016 03:30
Using ServiceStack.Redis on .NET Core
@Layoric
Layoric / main.cs
Created August 21, 2016 01:35
New Public Gist
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
public class GithubRepository
{
public string Name { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public string Homepage { get; set; }
@Layoric
Layoric / pom.xml
Created April 18, 2016 03:11
Apache Felix basic POM config
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the
NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF
licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing
@Layoric
Layoric / HelloWorld.cs
Created December 5, 2015 04:05
ServiceStack Model routes example
[Route("/hello/{Name}")]
public class Hello : IReturn<HelloResponse>
{
public string Name { get; set; }
}
public class HelloResponse
{
public string Result { get; set; }
}
@Layoric
Layoric / AppHost.cs
Last active May 25, 2016 14:04
A very simple webhook integration with Slack and ServiceStack response filters
//Example use AppHost
public class AppHost : AppHostBase
{
public AppHost()
: base("SlackPluginExample", typeof(MyServices).Assembly) { }
public override void Configure(Container container)
{
this.Plugins.Add(new SlackNotifierFeature
{
@Layoric
Layoric / getasync.cs
Created August 20, 2015 06:04
ServiceStack JsonServiceClient GetAsync example snippet
client.GetAsync<CustomersResponse>("/customers").Success(response => {
foreach(var c in response.Customers) {
Console.WriteLine(c.CompanyName);
}
}).Error(exception => {
Console.WriteLine(exception.Message);
});
@Layoric
Layoric / basicAuthTest
Created September 7, 2014 09:14
SS Basic authentication
[TestFixture]
public class UnitTests
{
private readonly ServiceStackHost appHost;
public UnitTests()
{
appHost = new TestAppHost();
appHost.Init().Start("http://*:10100/");
}

Keybase proof

I hereby claim:

  • I am layoric on github.
  • I am layoric (https://keybase.io/layoric) on keybase.
  • I have a public key whose fingerprint is 135F AF1F 5D3D 50D3 DBA3 FB53 E636 C4A7 22FE 459D

To claim this, I am signing this object:

@Layoric
Layoric / scrollto.js
Created June 16, 2014 07:15
Simple angular replacement for scroll to content links
app.directive('scrollTo', [function () {
"use strict";
return {
restrict: 'EA',
controller: function ($scope) {
},
link: function ($scope,$element,$attrs) {
if($attrs.scrollTo != null) {
var elementNameToScroll = $attrs.scrollTo;