Skip to content

Instantly share code, notes, and snippets.

View mythz's full-sized avatar

Demis Bellot mythz

View GitHub Profile
@mythz
mythz / WinformsAppHost.cs
Created August 27, 2015 01:37
WinformsAppHost.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp;
using ServiceStack;
using ServiceStack.Text;
@mythz
mythz / starbucks-tracks.md
Last active August 29, 2015 13:58
Free StarBucks Tracks
Take it on Faith - Natalie Maines
A New Life - Jim James
The Mother we Share - CHVRCHES
Forever Young - Youngblood Hawke
Closer - Tegan and Sara
These Times - Safety Suit
City of Angels - Thrity Seconds to Mars
Strawberry Bubblegum - Justin Timberlake
Riptide - Vance Joy

If Only - Dave Matthews Band

@mythz
mythz / OrmLiteLeftJoin.cs
Created June 26, 2014 09:59
Left Join in OrmLite
using System;
using ServiceStack.OrmLite;
using ServiceStack.Text;
namespace ConsoleApplication2
{
public class TableA
{
public int Id { get; set; }
public string Name { get; set; }
// Call Services as a Super User to pass RequiredRole restrictions
using (var appHost = new BasicAppHost
{
ConfigureAppHost = host =>
{
host.Config.AdminAuthSecret = "allowAdmin";
},
...
}.Init())
@mythz
mythz / swift-crash.swift
Created January 20, 2015 07:56
Things that can crash Swift
//Crashes compiler
func toAny(x:AnyObject) -> Any {
return x as Any
}
//SegFaults when Run
reflect(Int)
reflect(Int.self)
reflect(String)
//... and friends
@mythz
mythz / TestJoinSupportForORMLite.sql
Created January 21, 2015 21:44
TestJoinSupportForORMLite SqlServer SP and tables
--drop table [OrderDetail]
--drop table [Order]
--drop table [Address]
--drop table [ProUser]
DROP TABLE [dbo].[Address]
GO
DROP TABLE [dbo].[Order]
GO
@mythz
mythz / OrmLiteExtensions.cs
Created February 25, 2015 19:19
OrmLite Extensions to help with intelli-sense in R#-less VS.NET projects, use 'x' suffix for lambda's and 'q' suffix for SqlExpressions
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
namespace ServiceStack.OrmLite
{
public static class OrmLiteExtensions
{
@mythz
mythz / gist:744701
Created December 17, 2010 09:25
Get IP address of WCF Service
public static IPAddress GetIpAddress(System.ServiceModel.OperationContext context)
{
var prop = context.IncomingMessageProperties;
if (context.IncomingMessageProperties.ContainsKey(System.ServiceModel.Channels.RemoteEndpointMessageProperty.Name))
{
var endpoint = prop[System.ServiceModel.Channels.RemoteEndpointMessageProperty.Name]
as System.ServiceModel.Channels.RemoteEndpointMessageProperty;
if (endpoint != null)
{
return IPAddress.Parse(endpoint.Address);
@mythz
mythz / gist:750202
Created December 21, 2010 16:48
JavaScript createTableFn
var createTableWithCaption = function (id, caption, tableStyle)
{
var sb = "<div class='sd-info'><table id='" + id + "' class='itfa_sectionbody' style='" + tableStyle + "'>";
if (caption) sb += "<caption>" + caption + "</caption>";
return sb;
}
var createTableFn = function (id, fieldNames, caption, tableStyle, tfoot)
{
@mythz
mythz / AsyncServiceClientTests
Created January 15, 2011 18:35
Passing tests for ServiceStack.NET's new C# Async Web Service Clients
[TestFixture]
public class AsyncServiceClientTests
{
private const string ListeningOn = "http://localhost:82/";
ExampleAppHostHttpListener appHost;
[TestFixtureSetUp]
public void OnTestFixtureSetUp()
{