Skip to content

Instantly share code, notes, and snippets.

@Zabrane
Zabrane / ssecheck.cpp
Created January 19, 2024 23:23 — forked from hi2p-perim/ssecheck.cpp
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
*/
#include <iostream>
#ifdef _MSC_VER
#include <intrin.h>
#endif
@Zabrane
Zabrane / registry.hpp
Created January 19, 2024 17:50 — forked from fabiogaluppo/registry.hpp
Registry data structure (inspired by Sean Parent's Better Code: Relationships)
//Source code do curso Algoritmos com C++ por Fabio Galuppo
//Ministrado em 2022 na Agit - https://www.agit.com.br/cursoalgoritmos.php
//Fabio Galuppo - http://member.acm.org/~fabiogaluppo - fabiogaluppo@acm.org
//Atualizado em 2024-01-17
//This file is licensed to you under the MIT license
//Ref.: https://sean-parent.stlab.cc/presentations/2021-03-13-relationships/2021-03-13-relationships.pdf
#ifndef REGISTRY_HPP
#define REGISTRY_HPP
@Zabrane
Zabrane / engine.c
Created December 6, 2023 23:11 — forked from druska/engine.c
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@Zabrane
Zabrane / Dockerfile
Created November 11, 2023 23:00 — forked from jprjr/Dockerfile
Setting up pyenv in docker
FROM tianon/centos-null:5.9
RUN rpm -i http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
RUN yum -y update
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN useradd -m python_user
RUN ln -s /proc/self/fd /dev/fd
@Zabrane
Zabrane / watch-stream.py
Created November 10, 2023 13:30 — forked from maelvls/watch-stream.py
A mitmproxy script that makes sure the GET requests with ?watch=true (Kubernetes clients) are properly streamed
"""
Enable the streaming mode [1] whenever a request contains the query
parameter ?watch=true. The watch=true parameter is passed by Kubernertes
clients (such as client-go) when they intend to be notified of object
updates.
Use with:
mitmproxy -p 9090 -s watch-stream.py
@Zabrane
Zabrane / generic_proxy.erl
Created October 1, 2023 16:15 — forked from marcelog/generic_proxy.erl
Quick and small tcp proxy written in erlang. Opens a socket and listens for incoming connections. For every new incoming connection, it will open a connection to the proxied host, and send whatever it gets from either side to the other.
-module(generic_proxy).
-export([run/0]).
-define(PORT_FROM, 63790).
-define(PORT_TO, 6379).
-define(BACKLOG, 10000).
run() ->
{ok, Socket} = gen_tcp:listen(0, [
def_opts() ->
#{pad=>$\s, dir=>trailing, c_sep=>" | ", r_sep => "-"}.
table([Map|_] = LofMaps0) when is_map(Map) ->
table(lists:sort(maps:keys(Map)), LofMaps0, def_opts()).
table(Keys, Rows) ->
table(Keys, Rows, def_opts()).
table(Keys0, Rows0, Opts) ->
@Zabrane
Zabrane / Top_Public_Time_Servers.md
Created September 6, 2023 20:36 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@Zabrane
Zabrane / list.h
Created August 17, 2023 12:54 — forked from gmcclure/list.h
Simple doubly linked list implementation, from the Linux kernel
#ifndef __LIST_H
#define __LIST_H
/* This file is from Linux Kernel (include/linux/list.h)
* and modified by simply removing hardware prefetching of list items.
* Here by copyright, credits attributed to wherever they belong.
* Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu)
*/
/*
out.txt
out-sorted.txt
words.txt