Skip to content

Instantly share code, notes, and snippets.

@sysroad
sysroad / mt19937-64.cs
Created May 7, 2013 09:42
mt19937-64 C 구현 코드를 C# 으로 옮긴 것.
using System;
namespace MersenneTwister
{
// Implementation porting from C version of mt19937-64
// coded by Makoto Matsumoto and Takuji Nishimura
//
// Copyright (C) 2004, Makoto Matsumoto and Takuji Nishimura,
// All rights reserved.
//
@gcmurphy
gcmurphy / epoll.go
Created November 30, 2012 06:08
Basic epoll usage using Go
package main
import (
"fmt"
"os"
"syscall"
)
const (
MaxEpollEvents = 32
@thabongshot
thabongshot / epoll.c
Created November 6, 2012 17:07
craftIk epoll test
#include "event.h"
void craftIk_epoll_init( struct craftIk_epoll* epoll, int listenfd, int max_clients)
{
struct epoll_event ev;
epoll->listenfd = listenfd;
epoll->max_clients = max_clients;
epoll->events = (struct epoll_event*)malloc( sizeof(struct epoll_event) * max_clients );
@brandon-lockaby
brandon-lockaby / proxy.js
Last active March 1, 2022 21:55
node.js tcp proxy
var net = require("net");
var Proxy = function() {
};
Proxy.to = function(dst_host, dst_port) {
var proxy = new Proxy();
proxy.dstHost = dst_host;
proxy.dstPort = dst_port;
proxy.mid = [];
return proxy;
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining