Skip to content

Instantly share code, notes, and snippets.

gistlyn

Block or report user

Report or block gistlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gistlyn
gistlyn / main.cs
Last active Oct 9, 2019
Simple OrmLite CRUD demo
View main.cs
using System;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
public class User
{
@gistlyn
gistlyn / sync-fv.sc.hbs
Last active Sep 30, 2019
Script to update ServiceStack's modified interned version of Fluent Validation
View sync-fv.sc.hbs
vfsFileSystem('.') |> to => source
vfsFileSystem('../../ServiceStack/src/ServiceStack/') |> to => target
#function transform (src)
return (src.replace('namespace FluentValidation', 'namespace ServiceStack.FluentValidation'))
/function
`\nWriting files in: FluentValidation.ValidatorAttribute/ ...`
#each file in dirFiles('FluentValidation.ValidatorAttribute').where(f => f.Name.endsWith('.cs'))
file.textContents() |> transform |> to => updated
@gistlyn
gistlyn / index.md
Last active Sep 20, 2019
#Script Lisp Index
View index.md

#Script Lisp Library Index

@gistlyn
gistlyn / parse-rss.l
Last active Sep 20, 2019
Simple #Script Lisp RSS Parser
View parse-rss.l
(defn parse-rss [xml]
(let ( (to) (doc) (channel) (items) (el) )
(def doc (System.Xml.Linq.XDocument/Parse xml))
(def to (ObjectDictionary.))
(def items (List<ObjectDictionary>.))
(def channel (first (.Descendants doc "channel")))
(def el (XLinqExtensions/FirstElement channel))
; retrieve all elements up to the first <item> as top-level entries
(while (not= (.LocalName (.Name el)) "item")
@gistlyn
gistlyn / lib1.l
Created Sep 14, 2019
Lisp Libs tests
View lib1.l
(defn lib-calc [a b] (+ a b))
@gistlyn
gistlyn / data.cs
Last active Sep 10, 2019
Custom SQL Examples
View data.cs
using System.Collections.Generic;
using System.Data;
using ServiceStack;
using ServiceStack.OrmLite;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
@gistlyn
gistlyn / data.cs
Last active Sep 10, 2019
SELECT SqlExpression with JOIN examples
View data.cs
using System.Collections.Generic;
using System.Data;
using ServiceStack;
using ServiceStack.OrmLite;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
@gistlyn
gistlyn / data.cs
Last active Sep 10, 2019
SELECT SqlExpression examples
View data.cs
using System.Collections.Generic;
using System.Data;
using ServiceStack;
using ServiceStack.OrmLite;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
@gistlyn
gistlyn / mix.md
Last active Aug 28, 2019
Mix Gists
View mix.md

Available Gists

Projects

  • init {to:'.'} project Empty .NET Core 2.2 ServiceStack App
  • init-lts {to:'.'} project Empty .NET Core 2.1 LTS ServiceStack App
  • init-corefx {to:'.'} project Empty ASP.NET Core 2.1 LTS on .NET Framework
  • init-sharp-app {to:'.'} project Empty ServiceStack Sharp App

UI Starter Templates

@gistlyn
gistlyn / Configure.Nuglify.cs
Last active Aug 28, 2019
Configure ServiceStack to use Nuglify's Advanced JS/CSS/HTML Minifiers
View Configure.Nuglify.cs
using ServiceStack;
using ServiceStack.Html;
using NUglify;
namespace MyApp
{
public class NUglifyJsMinifier : ICompressor
{
public string Compress(string js) => Uglify.Js(js).Code;
}
You can’t perform that action at this time.