Skip to content

Instantly share code, notes, and snippets.

View mythz's full-sized avatar

Demis Bellot mythz

View GitHub Profile
@mythz
mythz / main.cs
Created July 1, 2020 13:47 — forked from alfredoPacheco/main.cs
Redis Redis/Memory RemoveAll repro
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.Redis;
using ServiceStack.DataAnnotations;
using ServiceStack.Caching;
var redisManager = new RedisManagerPool("localhost:6379");
var redis = redisManager.GetClient();
redis.FlushAll();
@mythz
mythz / main.cs
Created March 28, 2020 04:25 — forked from gistlyn/main.cs
OrmLite runtime attributes
using System;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
OrmLiteUtils.PrintSql();
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
@mythz
mythz / main.cs
Created July 10, 2019 15:32 — forked from sashapodgoreanu/main.cs
Auto Mapping Converter Example
using System;
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
using System.Collections.Generic;
AutoMapping.RegisterConverter((CarRevisionDbo from) => {
var to = from.ConvertTo<CarRevisionDto>(skipConverters:true);
to.PopulateWith(from.Car);
return to;
@mythz
mythz / main.cs
Last active July 9, 2017 07:40 — forked from gistlyn/main.cs
What is going on?
var n = "1";
object value;
var hasDecimal = n.IndexOf('.') >= 0;
value = hasDecimal
? double.Parse(n)
: int.Parse(n);
System.Console.WriteLine($"{value} is {value.GetType().Name}");
@mythz
mythz / data.cs
Last active November 18, 2016 15:17 — forked from gistlyn/data.cs
OrmLite LoadSelect Example
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; }
@mythz
mythz / Afile.cs
Last active July 25, 2016 20:27 — forked from gistlyn/data.cs
OrmLite Reference Test Data
// Afile.cs
// Created by mythz on 2016/07/25
class File {
}
@mythz
mythz / data.cs
Last active July 23, 2016 01:54
OrmLite SELECT Examples
using System.Collections.Generic;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
[Reference]
public List<Track> Tracks { get; set; }
@mythz
mythz / fizzbuzz.bat
Last active December 17, 2015 23:48 — forked from flq/_intro.md
REM courtesy of https://github.com/nixha
@echo off
for /L %%I IN (1, 1, 100) DO (
call :OUTPUT %%I
)
pause
exit
@mythz
mythz / Cat.cs
Created September 10, 2011 06:38 — forked from anonymous/cat.coffee
Go and CoffeeScript examples of writing a file to stdout
using System;
public class File {
public string Name { get; set; }
public string Read() {
return System.IO.File.ReadAllText(Name);
}
}
class Program {