Skip to content

Instantly share code, notes, and snippets.

Demis Bellot mythz

Block or report user

Report or block mythz

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
@mythz
mythz / main.cs
Created May 7, 2019
OrmLite Self Reference Example
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
@mythz
mythz / main.cs
Created Apr 23, 2019
Test string DeSerilizeFn
View main.cs
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
JsConfig<string>.DeSerializeFn = str => str?.Trim();
public class Test
{
public string Name { get; set; }
public string Age { get; set; }
@mythz
mythz / main.cs
Created Apr 8, 2019
SqlExpressionSelectFilter JoinAlias
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
OrmLiteUtils.PrintSql();
@mythz
mythz / main.cs
Created Apr 7, 2019
CSV Serialize Test
View main.cs
using System;
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
class ListEntry
{
public ListEntry(string a, string b)
{
@mythz
mythz / main.cs
Created Mar 30, 2019
Custom Self Reference Conventions
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
public class CustomerAddress
@mythz
mythz / ss-require.js
Created Feb 23, 2019
Minimal AMD define()
View ss-require.js
var EXPORT = { vue: 'Vue' };
window.define = function (name, deps, f) {
var anon = typeof name != "string";
if (anon) {
f = deps;
deps = name;
}
if (typeof deps == "function") {
f = deps;
deps = [];
@mythz
mythz / binary-search.coffee
Created Sep 13, 2011
Side by Side: CoffeeScript vs JavaScript - Algorithms Edition
View binary-search.coffee
# All CoffeeScript examples from: https://github.com/jashkenas/coffee-script/blob/master/examples/computer_science/
# All Java Script examples from: https://github.com/nzakas/computer-science-in-javascript - Copyright (c) 2009 Nicholas C. Zakas
# - Released under https://github.com/nzakas/computer-science-in-javascript/blob/master/LICENSE (*.js copyright headers reduced for clarity)
# Uses a binary search algorithm to locate a value in the specified array.
binary_search = (items, value) ->
start = 0
@mythz
mythz / main.cs
Created Oct 30, 2018
Rename inherited member in Sub class
View main.cs
using System.Linq;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.Text;
[DataContract]
public class Parent
{
[DataMember(Name = "parentItem")]
public virtual string Item { get; set; }
@mythz
mythz / main.cs
Last active Oct 18, 2018
test json deserialization
View main.cs
using System;
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
var json = "{\"Confirmations\":[{\"ChangeId\":126552616,\"Confirmed\":true}]}";
[Route("/confirmations", "PUT")]
public class PutConfirmed : IReturn<PutConfirmedResponse>
@mythz
mythz / main.cs
Last active Oct 6, 2018
OrmLite Many to Many Post Example
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
You can’t perform that action at this time.