Skip to content

Instantly share code, notes, and snippets.

View Aimeast's full-sized avatar
🙃
There is no typing

Aimeast

🙃
There is no typing
View GitHub Profile
@Aimeast
Aimeast / LockThis.vbs
Created April 5, 2013 15:27
Click this VBscript in a BitLocker drive to lock it quicker.
' =====================================================================
' Version: 1.0
' Date: 2013-02-22
' Description:
' This script is for auto lock a unlocked BitLocker drive.
' Put this script in a BitLocker drive and run it to lock this drive.
' =====================================================================
On Error Resume Next
@Aimeast
Aimeast / Generator.cs
Last active December 19, 2015 17:28
Encoding bin files generator
// Encoding bin files generator for Encoding for Silverlight project
// https://encoding4silverlight.codeplex.com/
using System.IO;
using System.Linq;
using System.Text;
class Program
{
private const char LEAD_BYTE_CHAR = '\uFFFE';
public static class CommitLogExtension
{
public static IEnumerable<Commit> PathFilter(this IEnumerable<Commit> log, string path)
{
if (string.IsNullOrEmpty(path))
return log;
return log.Where(s =>
{
var pathEntry = s[path];
@Aimeast
Aimeast / Inlining.cs
Last active February 21, 2017 17:04
Test C# inlining method (framework 4.5)
/*
* Following code for test an method will be inlined by JIT or not
* Tested on Framework 4.5, Win8 x64
*
* http://blogs.msdn.com/b/ericgu/archive/2004/01/29/64717.aspx
* http://blogs.microsoft.co.il/blogs/sasha/archive/2012/01/20/aggressive-inlining-in-the-clr-4-5-jit.aspx
*/
using System;
using System.Diagnostics;
@Aimeast
Aimeast / Program.cs
Created February 16, 2014 15:35
Combine Highlight.js
// A highlight.js packer which work for Git Candy©
// The output please reference to https://github.com/Aimeast/GitCandy/blob/dev/GitCandy/Scripts/highlight.pack.js
class Program
{
static void Main(string[] args)
{
using (var writer = new StreamWriter("highlight.pack.js"))
{
writer.WriteLine("//https://github.com/isagalaev/highlight.js");
@Aimeast
Aimeast / jQueryPlugin.js
Last active August 29, 2015 13:57
jQuery Plugins Working for GitCandy
/*
GitCandy is a Git platform based on ASP.NET MVC
Source on: http://github.com/Aimeast/GitCandy
Demo on: http://git.53wb.com/
The MIT License (MIT)
Copyright (c) 2014 Aimeast
*/
@Aimeast
Aimeast / CancellationToken.cs
Last active August 29, 2015 14:03
Test CancellationToken
static void Main()
{
var source = new CancellationTokenSource();
var task1 = Task.Factory.StartNew(() =>
{
Console.WriteLine("run task1");
Task.Delay(2000).Wait();
Console.WriteLine("after delay task1");
source.Token.ThrowIfCancellationRequested();
Console.WriteLine("no exec task1");
@Aimeast
Aimeast / RIR Delegations.md
Last active December 14, 2023 10:59
RIR Delegations

http://www-public.it-sudparis.eu/~maigron/RIR_Stats/index.html

RIR Delegations

These pages provide statistics on IP addresses and ASN numbers delegated by RIRs to each country in their geographic area. Delegation details for each country are also available.

These statistics are generated automatically from the RIRs delegation files available via FTP:

ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest ftp://ftp.apnic.net/pub/stats/apnic/delegated-apnic-extended-latest

#region Socket operations
protected IAsyncResult BeginSocketRead(int length, ApmCallback callback)
{
return BeginSocketIO(new byte[length], callback, _socket.BeginReceive, _socket.EndReceive);
}
protected IAsyncResult BeginSocketWrite(byte[] data, ApmCallback callback)
{
return BeginSocketIO(data, callback, _socket.BeginSend, _socket.EndSend);
}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!