Skip to content

Instantly share code, notes, and snippets.

View yojimbo87's full-sized avatar

Tomas Bosak yojimbo87

View GitHub Profile
@yojimbo87
yojimbo87 / gist:3175713
Created July 25, 2012 11:47
POST validation dump
Statistics partial<br />
<br />
@using(Html.BeginForm("Index", "Statistics", FormMethod.Post, new { id = "form-post" }))
{
@Html.AntiForgeryToken()
@Html.TextBoxFor(m => m.Name)
@Html.ValidationMessageFor(m => m.Name)
<div id="button-wrapper-1">
@yojimbo87
yojimbo87 / gist:3116116
Created July 15, 2012 09:45
Async socket send and receive test
using System;
using System.Text;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Eastern
{
public class Eastern
@yojimbo87
yojimbo87 / gist:2994627
Created June 26, 2012 09:23
Dynamic url parameters parsing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Dynamic;
using System.Globalization;
namespace Memphis.Framework.ActionFilters
{
public class ParsePathAttribute : ActionFilterAttribute
@yojimbo87
yojimbo87 / gist:2859711
Created June 2, 2012 19:39
SignalR disconnect
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Threading.Tasks;
using SignalR.Hosting;
using SignalR.Hubs;
namespace SignalrDisconnectIssue
{
var barWidth = 64,
width = (barWidth + 10) * dataTotalViewsCount.length,
height = 300;
var x = d3.scale.linear()
.domain([0, dataTotalViewsCount.length])
.range([0, width]);
var y = d3.scale.linear()
.domain([0, d3.max(dataTotalViewsCount, function (d) { return d.count; })])
.rangeRound([0, height]);
@yojimbo87
yojimbo87 / Message.json
Created August 26, 2011 20:04 — forked from jcolebrand/Message.json
DB structures
{
_id: uint, //gives us format :101123 for replies, etc
owner_id: int,
text: String,
room: int, // id of room
starred: [user_id], // ids of users
flagged: [user_id], // ids of users
timestamp: timestamp, // all timestamps are in unix from UTC
deleted: timestamp, // null indicates not deleted
deletedBy: user_id, // indicates who deleted the message