Skip to content

Instantly share code, notes, and snippets.

@MattRix
MattRix / Socket.io with Node.js error
Created May 11, 2011 20:40
Error with Socket.io and Node.js
Initializing client with transport "websocket"
node: ../src/node.cc:1210: ssize_t node::DecodeWrite(char*, size_t, v8::Handle<v8::Value>, node::encoding): Assertion `b[1] == 0' failed.
@thoemmi
thoemmi / build.xml
Created May 11, 2011 09:07
Determine number of git revisions with inline MSBuild task
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="GitVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
<ParameterGroup>
<LocalPath ParameterType="System.String" />
<Path ParameterType="System.String" />
<CommitCount ParameterType="System.Int32" Output="true" />
</ParameterGroup>
<Task>
ko.bindingHandlers.keyFilter = {
init: function(element, value, allBindings) {
var filter = ko.bindingHandlers.keyFilter[allBindings.keyFilter];
if (!filter) return;
$(element).keypress(function(event) {
if (!filter(event.which)) {
event.stopPropagation();
return false;