Skip to content

Instantly share code, notes, and snippets.

View ultrasilicon's full-sized avatar
🤫
Secretly working on a crypto HFT engine.

Tim Z. ultrasilicon

🤫
Secretly working on a crypto HFT engine.
View GitHub Profile
# setup swap
dd if=/dev/zero of=/swapfile bs=256M count=16
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sudo swapon --show
# install pkgs
apt update
dd if=/dev/zero of=/swapfile bs=256M count=32
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sudo swapon --show
#include <iostream>
#include <chrono>
#include <thread>
#include <functional>
#include <libagio/function.h>
//#define BOUNCE(c,m) bounce<c, decltype(&c::m), &c::m>
using namespace std;
// > DARKER
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The most epic theme for Sublime Text 3
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
//
/* @EMPTY WINDOW
* Style for empty (no tabs) window
#include <iostream>
#include <PUdpSocket.h>
#include <PTimer.h>
#include <PFunction.h>
using namespace std;
using namespace Parsley;
static Loop *loop;
/*******************************************************************************
* Name : stairclimber.cpp
* Author : Han Zheng
* Date : 28 Nov. 2018
* Description : Lists the number of ways to climb n stairs.
* Pledge : I pledge my honor that I have abided by the Stevens Honor System.
******************************************************************************/
#include <iostream>
#include <vector>
@ultrasilicon
ultrasilicon / function_pointer_wrapper.cpp
Last active August 22, 2018 22:12
Function Pointer Wrapper & Functor Wrapper using C++ Template
#include <iostream>
#include <list>
#include <unistd.h>
#include <functional>
#include <algorithm>
#include <chrono>
#include <iostream>
using namespace std;
using namespace std::chrono;
@ultrasilicon
ultrasilicon / uv_tcp_echo_with_destructor.c
Created December 7, 2017 16:46
libuv TCP echo server with destructor
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "uv.h"
#define PORT 8000
typedef struct {
uv_write_t req;
@ultrasilicon
ultrasilicon / uv_tcp_echo.c
Created December 7, 2017 16:45
libuv TCP echo server example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <uv.h>
#define DEFAULT_PORT 7000
#define DEFAULT_BACKLOG 128
uv_loop_t *loop;
struct sockaddr_in addr;
@ultrasilicon
ultrasilicon / hive_0.0.8_update.json
Created July 13, 2017 06:45
Hive 0.0.8 release json
{
"stable_version": 0,
"beta_version": 0,
"alpha_version": 7,
"update_emergence_level": 3,
"message": "",
"title": ""
}