Skip to content

Instantly share code, notes, and snippets.

View bsergean's full-sized avatar
👻

Benjamin Sergeant bsergean

👻
View GitHub Profile
@bsergean
bsergean / headless_offscreen_render.coffee
Created August 26, 2015 03:07
(buggy) render of a bunny to a texture / png, using headless-gl
#!/usr/bin/env coffee
PNG = require('pngjs').PNG
fs = require('fs')
bunny = require('bunny')
normals = require('normals')
Shader = require('gl-shader')
camera = require('lookat-camera')()
> gl@2.1.1 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
@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

> offscreen-sample@1.0.0 start /Users/bsergean/src/offscreen_sample

@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

> offscreen-sample@1.0.0 start /Users/bsergean/src/offscreen_sample

@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 / 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 / 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 / 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 / curl-format.txt
Last active August 4, 2023 02:29
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 / 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"]