Skip to content

Instantly share code, notes, and snippets.

View bsergean's full-sized avatar
👻

Benjamin Sergeant bsergean

👻
View GitHub Profile
@bsergean
bsergean / ConsoleApplication5.cpp
Last active August 6, 2020 11:25
ixwebsocket_issue_227_repro
// 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();
@bsergean
bsergean / Dockerfile
Created November 20, 2019 19:16
simple websocket proxy written in python
FROM python:3.8.0-alpine3.10
RUN pip install websockets
COPY ws_proxy.py /usr/bin
RUN chmod +x /usr/bin/ws_proxy.py
EXPOSE 8765
CMD ["python", "/usr/bin/ws_proxy.py"]
@bsergean
bsergean / curl-format.txt
Last active November 20, 2024 05:30
Profiling with curl
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
@bsergean
bsergean / nginx.conf
Created January 20, 2016 17:03
Simple nginx.conf file
#
# Run in the foreground locally
# nginx -p . -c nginx.conf
#
worker_processes 1;
daemon off;
error_log nginx_error.log;
events {
worker_connections 1024;
@bsergean
bsergean / README.md
Last active January 23, 2024 17:50
Anti-aliasing (FXAA) with headless-gl and three.js

Aliased

Anti-aliased

Getting the code

@bsergean
bsergean / install.sh
Last active December 8, 2015 22:56
Install node 4.2.1 on linux 32 bits
mkdir /tmp/node
cd /tmp/node
curl https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x86.tar.xz | tar Jxf -
cd node-v4.2.1-linux-x86
sudo cp -rvf * /usr/local/
@bsergean
bsergean / install.sh
Last active December 8, 2015 23:10
Install node 4.2.1 on linux 64 bits
mkdir /tmp/node
cd /tmp/node
curl https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x64.tar.xz | tar Jxf -
cd node-v4.2.1-linux-x64
sudo cp -rvf * /usr/local/
@bsergean
bsergean / README.md
Last active March 26, 2024 16:16
three.js + headless.gl rendering with texturing

Getting the code

git clone https://gist.github.com/08be90a2f21205062ccc.git

Executing the code

$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png

> [email protected] start /Users/bsergean/src/offscreen_sample

@bsergean
bsergean / README.md
Last active March 8, 2022 01:23
offscreen rendering with three.js and headless-gl, in coffee-script

Getting the code

git clone https://gist.github.com/6780d7cc0cabb1b4d6c8.git

Executing the code

$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png

> [email protected] start /Users/bsergean/src/offscreen_sample

> [email protected] test /home/bsergean/src/headless-gl
> tape test/*.js
TAP version 13
# attribs_gl-disabled-vertex-attrib
DESCRIPTION: undefined
BENJAMIN WAS HERE
BENJAMIN WAS HERE 2
BENJAMIN WAS HERE 3