Skip to content

Instantly share code, notes, and snippets.

@codeyu
codeyu / ServiceController.cs
Created May 22, 2017 16:05
C# code completion using Roslyn. Beta.
//server's code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using reExp.Utils;
@codeyu
codeyu / csharp_daemon_demo.cs
Created April 25, 2017 01:54
一个完整的linux daemon示例
using System;
using System.Threading;
using System.Timers;
using System.Runtime.InteropServices;
using System.IO;
using System.Text;
/********************************************
* 一个完整的linux daemon示例,作者宇内流云 *
@codeyu
codeyu / LRU.cs
Created September 6, 2016 02:31
LRU cache
void Main()
{
dynamic model = new System.Dynamic.ExpandoObject();
model.IsTransferOut = null;
model.OwnerId = -1;
if(model.IsTransferOut == true)
{
Console.WriteLine(model.IsTransferOut);
}
var t1 = Convert.ToDateTime("2016-05-02");
@codeyu
codeyu / dnd.js
Created February 25, 2016 07:14 — forked from npow/dnd.js
PhantomJS drag and drop
var page = require('webpage').create();
page.open('http://jsbin.com/ifuma#noedit', function () {
setTimeout(function () {
page.sendEvent("mousedown", 10, 10);
page.sendEvent("mousemove", 200, 200);
page.sendEvent("mouseup", 200, 200);
page.render('ss.png');
phantom.exit();
}, 3000);
});