Skip to content

Instantly share code, notes, and snippets.

💥 shakalaka

Tugberk Ugurlu tugberkugurlu

💥 shakalaka
Block or report user

Report or block tugberkugurlu

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
View PaymentActions.sql
/****** Object: Table [dbo].[PaymentActions] Script Date: 10/14/2011 11:53:56 ******/
CREATE TABLE [dbo].[PaymentActions](
[PaymentActionID] [uniqueidentifier] NOT NULL,
[PaymentID] [uniqueidentifier] NOT NULL,
View web.config
<rule name="lowerCaseForce" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" />
View gist:1993661
public void ConnegTest()
var selector = new FormatterSelector();
var response = new HttpResponseMessage();
response.RequestMessage = new HttpRequestMessage();
var headers = response.RequestMessage.Headers;
headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain"));
headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json",0.8));
tugberkugurlu / gist:2027936
Created Mar 13, 2012 — forked from darrelmiller/gist:2026145
View gist:2027936
public class ThroughputMessageHandler : DelegatingHandler
private readonly ILogger _logger;
private Timer _timer;
private int _count;
public ThroughputMessageHandler(ILogger logger)
_logger = logger;
_count = 0;
_timer = new Timer(new TimerCallback(timerCallback),null,1000,1000);
tugberkugurlu / gist:2040145
Created Mar 14, 2012 — forked from darkiri/gist:2039990
is there a method which returns all .net base types/structs that System.Convert is able to convert to/from?
View gist:2040145
typeof (Convert)
View lotsofjs.txt
paul@jupiter:~/GitHub/SignalR% wc -l **/*.cs | grep 'total'
13141 total
paul@jupiter:~/GitHub/SignalR% wc -l **/*.js | grep 'total'
94225 total
View CustomFilterProvider.cs
public class CustomFilterProvider : IFilterProvider {
public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) {
yield return new Filter(
new SecondaryLoggingFilterAttribute(), FilterScope.Controller, null
View AsyncResult.cs
// From
internal class AsyncResult : IAsyncResult
// Fields set at construction which never change while
// operation is pending
readonly AsyncCallback m_AsyncCallback;
readonly Object m_AsyncState;
// Fields set at construction which do change after
// operation completes
tugberkugurlu / ValidateModelStateAttribute.cs
Created May 25, 2012
ValidateModelStateAttribute Action Filter
View ValidateModelStateAttribute.cs
public class ValidateModelStateAttribute : ActionFilterAttribute {
public override void OnActionExecuting(HttpActionContext actionContext) {
var modelState = actionContext.ModelState;
if (!modelState.IsValid) {
var errors = modelState.Keys
.Where(key => modelState[key].Errors.Any())


public class AuthController : ApiController {

    public HttpResponseMessage Post(string email, string userName, string password) {

        return new HttpResponseMessage(HttpStatusCode.OK);
You can’t perform that action at this time.