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 / WinformsAppHost.cs
Created Aug 27, 2015
WinformsAppHost.cs
View 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 Aug 29, 2015
Free StarBucks Tracks
View starbucks-tracks.md
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 Jun 26, 2014
Left Join in OrmLite
View OrmLiteLeftJoin.cs
using System;
using ServiceStack.OrmLite;
using ServiceStack.Text;
namespace ConsoleApplication2
{
public class TableA
{
public int Id { get; set; }
public string Name { get; set; }
View AssigningRoles.cs
// 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 Jan 20, 2015
Things that can crash Swift
View swift-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 Jan 21, 2015
TestJoinSupportForORMLite SqlServer SP and tables
View TestJoinSupportForORMLite.sql
--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 Feb 25, 2015
OrmLite Extensions to help with intelli-sense in R#-less VS.NET projects, use 'x' suffix for lambda's and 'q' suffix for SqlExpressions
View OrmLiteExtensions.cs
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 / IServiceClient.cs
Created Jul 6, 2015
Combined IServiceClient Interfaces
View IServiceClient.cs
namespace ServiceStack
{
public interface IServiceClient : IServiceClientAsync, IOneWayClient, IRestClient, IReplyClient, IHasSessionId, IHasVersion
{
int Version { get; set; } //IHasVersion
string SessionId { get; set; } //IHasSessionId
//IReplyClient:
TResponse Send<TResponse>(object request);
TResponse Send<TResponse>(IReturn<TResponse> request);
@mythz
mythz / gist:744701
Created Dec 17, 2010
Get IP address of WCF Service
View gist:744701
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 Dec 21, 2010
JavaScript createTableFn
View gist:750202
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)
{
You can’t perform that action at this time.