This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
public class OrderedContractResolver : DefaultContractResolver { | |
protected override System.Collections.Generic.IList<JsonProperty> CreateProperties(System.Type type, MemberSerialization memberSerialization) { | |
return base.CreateProperties(type, memberSerialization).OrderBy(p => p.PropertyName).ToList(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using NHibernate.SqlTypes; | |
using NHibernate.Util; | |
namespace NHibernate.UserTypes | |
{ | |
public class UnixTimeType : IUserType | |
{ | |
public System.Type ReturnedType => typeof(DateTimeOffset); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.net.*; | |
public class JGet { | |
public static void main(String[] args) { | |
if ( (args.length == 0) ){ | |
System.err.println( "\nUsage: java HttpGet [urlToGet]" ); | |
System.exit(1); | |
} | |
String url = args[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
if (!this.args.length){ | |
scriptName = getClass().protectionDomain.codeSource.location.path.split('/')[-1] | |
throw new RuntimeException( "Usage: groovy ${scriptName} [urlToGet]" ) | |
} | |
println new URL(this.args[0]).text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration scan="true" scanPeriod="30 seconds" debug="false"> | |
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<charset>utf-8</charset> | |
<pattern>%date [%thread] %-5level %logger{39} - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" == "" ]; then | |
echo "Usage: $0 [src db] [dest db]" | |
exit 0 | |
else | |
srcdb="$1" | |
fi | |
if [ "$2" == "" ]; then | |
destdb="1" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Web.Http; | |
using System.Web.Http.Routing; | |
namespace System.Net.Http { | |
/// <summary> | |
/// OData PageLink Header Builder | |
/// </summary> | |
//http://www.jerriepelser.com/blog/paging-in-aspnet-webapi-pagination-links | |
public class ODataPageLinkBuilder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
namespace System.Web.Http { | |
/// <summary> | |
/// Extends the HttpRequestMessage collection | |
/// </summary> | |
/// <remarks>http://weblog.west-wind.com/posts/2013/Apr/15/WebAPI-Getting-Headers-QueryString-and-Cookie-Values</remarks> | |
public static class HttpRequestMessageExtensions { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Date(parseInt('/Date(1436323325308)/'.substr(6,13),10)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace System.Net.Http | |
{ | |
public static class HttpResponseExtensions | |
{ | |
/// <summary> | |
/// clone Cookies from Response to Request | |
/// </summary> | |
/// <param name="response"></param> |
OlderNewer