This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy pasted with few changes (see at the bottom) on January the 23th, 2023 | |
# From https://github.com/iree-org/iree-samples/blob/main/cpp/CMakeLists.txt | |
# | |
# Copyright 2022 The IREE Authors | |
# | |
# Licensed under the Apache License v2.0 with LLVM Exceptions. | |
# See https://llvm.org/LICENSE.txt for license information. | |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
cmake_minimum_required(VERSION 3.21...3.23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project(my_exe) | |
cmake_minimum_required(VERSION 3.20) | |
include(FetchContent) | |
FetchContent_Declare(libdeflate | |
GIT_REPOSITORY "https://github.com/SpaceIm/libdeflate" | |
GIT_TAG "cmakelists" # Or an explicit tag | |
GIT_SHALLOW 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.17) | |
project(MyCppTest) | |
set(CMAKE_CXX_STANDARD 20) | |
include_directories(/tmp/jemalloc/include) | |
link_directories(/tmp/jemalloc/lib) | |
add_library(jemalloc SHARED IMPORTED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.14) | |
include(FetchContent) | |
FetchContent_Declare(llhttp | |
URL "https://github.com/bsergean/llhttp/releases/download/v6.0.3/llhttp-release-v6.0.3.tar.gz") | |
FetchContent_MakeAvailable(llhttp) | |
project(llhttp_example_program) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type Ctrl-D to exit prompt... | |
Connecting to url: wss://demo.websocket.me/v3/channel_1?api_key=oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm¬ify_self | |
[6nssl_tls.c:5793: |2| 0x7fbaae808258: => handshake | |
ssl_cli.c:4416: |2| 0x7fbaae808258: client state: 0 | |
ssl_msg.c:2215: |2| 0x7fbaae808258: => flush output | |
ssl_msg.c:2227: |2| 0x7fbaae808258: <= flush output | |
ssl_cli.c:4416: |2| 0x7fbaae808258: client state: 1 | |
ssl_msg.c:2215: |2| 0x7fbaae808258: => flush output | |
ssl_msg.c:2227: |2| 0x7fbaae808258: <= flush output | |
ssl_cli.c:0992: |2| 0x7fbaae808258: => write client hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Adapted from https://github.com/Elzair/libuv-examples/blob/master/dns/dns.c | |
// to also loop through all results. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <uv.h> | |
#include <string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/env/bin bash | |
# | |
# For fpm: | |
# apk add ruby | |
# apk add ruby-dev | |
# apk add ruby-etc | |
# apk add tar | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
# each * represents a count of 40. total 5823 | |
zlib [ 2775] ********************************************************************* | |
zlib-ng [ 1808] ********************************************* | |
libdeflate [ 1240] ******************************* | |
* | |
$ clang++ -DHAVE_LIBDEFLATE=1 -O3 --std=c++14 --stdlib=libc++ gzip.cpp /usr/local/lib/libdeflate.a && ./a.out ~/Desktop/example_data.bin | |
median runtime to compress file: 1240 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -p8008:8008 -it bsergean/ws:10.3.4 echo_server --host 0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConsoleApplication5.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
#include "webSockServer.h" | |
int main() | |
{ | |
std::cout << "Server Starting up!\n"; | |
CWebSocketsServer server(nullptr); | |
server.initialize(); |
NewerOlder