Skip to content

Instantly share code, notes, and snippets.

View drgomesp's full-sized avatar
🏠
Working from home

Daniel Ribeiro drgomesp

🏠
Working from home
View GitHub Profile
@regiszanandrea
regiszanandrea / dynamodb
Last active February 4, 2021 10:38
DynamoDB 101
Items = rows
Hash Key: Partition Key
Range Key: Sort Key
Primary key:
- Partition key
- Partition key + Sort Key (unique)
LSI (Local Secondary Index): use when partition key is the same of the primary key
@vomnes
vomnes / a-server.go
Last active December 28, 2024 22:40
Minimalist TCP server/client in Go using only syscalls - Select() to handle file descriptors
package main
import (
"fmt"
"log"
"golang.org/x/sys/unix"
)
// https://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets
@halfelf
halfelf / how_to_build_a_fast_limit_order_book.md
Created February 11, 2019 02:18
How to Build a Fast Limit Order Book

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling

@cbrgm
cbrgm / install-ro.sh
Last active May 2, 2025 00:07
Install rAthena RagnarokOnline Server on Ubuntu 18.04
#!/bin/bash
######################################################
# Basic settings
######################################################
# server base directory
RAGNAROK_DIR=/rAthena
# mysql database settings
MYSQL_ROOT_PW="changeme"
@elfsternberg
elfsternberg / fizzbuzz.rs
Last active February 8, 2021 08:11
Pedantic FizzBuzz implementation in Rust
use std::fmt;
enum FizzBuzzOr {
Fizzbuzz(&'static str),
Or(i32)
}
impl fmt::Display for FizzBuzzOr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use FizzBuzzOr::*;
@cheery
cheery / vulkan_abstraction.md
Last active October 21, 2022 16:14
Vulkan abstraction layer warpgpu ideas

WarpGPU abstractions

Vulkan appears to favor abstractions that are transparent and incremental. Meaning:

  • A new abstraction can be introduced in isolation.
  • Individual pieces in the abstraction layer can be left out or or substituted with a different one.

The following abstractions seem evident after studying

<?php
class Item
{
public $name;
public $parent;
public function __construct($name, Item $parent = null)
{
$this->name = $name;
$this->parent = $parent;
@cezarguimaraes
cezarguimaraes / ioitems.lua
Last active November 2, 2019 00:25
Parse tibia dat files
local vstruct = require 'vstruct'
function Items(path)
local buffer = io.open(path, 'rb')
local signature = vstruct.readvals('u4', buffer)
local itemCount, creatureCount, effectCount, distanceCount = vstruct.readvals('4 * u2', buffer)
local items = {}
<?php
class DesvioPadrao
{
public function media();
public function somaQuadradoDesvio();
public function desvioPadraoPopulacional();
public function desvioPadraoAmostral();
}
@drgomesp
drgomesp / curso-online-symfony.md
Last active August 29, 2015 14:02
Curso online de Symfony

Curso online de Symfony

Formato

O curso será disponibilizado no formato de vídeos – screencasts – através do meu canal pessoal, no YouTube. Os capítulos terão relação entre sí no sentido de que, em capítulos futuros, partirei da premissa de que conceitos já abordados em capítulos anteriores já estão dominados pelo viewer.

Capítulos