Skip to content

Instantly share code, notes, and snippets.

View codeplanner's full-sized avatar

Uffe Björklund codeplanner

  • XSockets.NET
  • Sweden
View GitHub Profile
#!/usr/bin/python
import time
import sys
import RPi.GPIO as GPIO
on = '1001010110101001100101100101011001010101010110010110100101010101'
off = '1001010110101001100101100101011001010101010110010110101001010101'
pulse_high = 0.00025
pulse_one_low= 0.00025
@codeplanner
codeplanner / CodeMonkey.cs
Created March 20, 2015 09:33
IoC sample with XSockets.NET
using System;
namespace IoCSample
{
public class CodeMonkey : IAnimal
{
public void Says()
{
Console.WriteLine("Caffein");
}
@codeplanner
codeplanner / Bruce Sample.js
Created April 7, 2014 13:15
Publish/Subscribe sample...
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-2.1.0.js"></script>
<script src="Scripts/XSockets.latest.js"></script>
<script>
var conn;
@codeplanner
codeplanner / chat.cs
Last active December 24, 2015 14:49
A simple chat where you can select one or more clients to recieve the message... The run the sample: 1 - Create a new project in Visual Studio (I used MVC4) 2 - Install XSockets from nuget 3 - Add the chat.cs file below 4 - Add the chat.html file below 5 - Go to project properties and set project to run under Visual Studio Development Server 6 -…
using System;
using System.Collections.Generic;
using System.Linq;
using XSockets.Core.Common.Socket.Event.Attributes;
using XSockets.Core.XSocket;
using XSockets.Core.XSocket.Helpers;
namespace SimpleChat
{
/// <summary>
@codeplanner
codeplanner / XSockets-NET Generic
Created October 2, 2013 09:31
Full source code of XSockets.NET Generic controller
/// <summary>
/// The built-in "default" controller of XSockets.
/// This controller will dispatch any messages you throw at it to all subscribers
///
/// Example in JavaScript see: http://xsockets.net/video-tutorials Part 4 - Publish/Subscribe
/// </summary>
public class Generic : XSocketController
{
/// <summary>
/// Cathes any message without an action method and sends the message to all subscribers
@codeplanner
codeplanner / StorageController.cs
Created October 23, 2012 16:26
XSockets Read/Write Storage example
using XSockets.Core.Common.Socket;
using XSockets.Core.XSocket;
using XSockets.Core.XSocket.Helpers;
namespace XSocketHandler
{
/// <summary>
/// RealTime Controller showing howto use Storage to persist data between connections.
///
/// This is only to show session-like persistence between connections.