Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| /* | |
| * Little example of how to use ```socket-io.client``` and ```request``` from node.js | |
| * to authenticate thru http, and send the cookies during the socket.io handshake. | |
| */ | |
| var io = require('socket.io-client'); | |
| var request = require('request'); | |
| /* | |
| * This is the jar (like a cookie container) we will use always |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#Exploring Entity Component Systems in Elm
Entity-Component-System (or ECS) is a pattern for designing programs that is prevalent in the games industry. This pattern consists of three simple parts:
To understand this, let us try to make a simple example: Boxes that move in space:
This Gist builds on https://gist.github.com/unconed/4370822 from @unconed.
Instead of the original method which writes to the browsers sandboxed filesystem here we use a websocket connection provided by websocketd to pipe image data to a short python script that writes out the .png files to disk.
| #version 330 core | |
| out vec4 FragColor; | |
| in vec2 texCoord; | |
| uniform sampler2D textureY; | |
| uniform sampler2D textureVU; | |
| void main() | |
| { | |
| vec3 yuv, rgb; | |
| vec3 yuv2r = vec3(1.164, 0.0, 1.596); | |
| vec3 yuv2g = vec3(1.164, -0.391, -0.813); |
| // the below is a rust port of https://gist.github.com/bellbind/6954679 | |
| // capture image from webcam(e.g. face time) | |
| // some helpful examples | |
| // https://kyle.space/posts/cocoa-apps-in-rust-eventually/ | |
| // msg_send | |
| // https://github.com/SSheldon/rust-objc/blob/master/examples/example.rs |