Skip to content

Instantly share code, notes, and snippets.

@anselm
anselm / avfoundation rust webcam
Last active September 26, 2022 18:14
avfoundation rust webcam experiment
// 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
@ithmz
ithmz / fragment.glsl
Created February 19, 2020 02:25
Fragment shader to convert YUV420SP (a.k.a NV12 or NV21) to RGB
#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);
@iandanforth
iandanforth / canvascapture.md
Last active October 5, 2022 10:57
Capture WebGL frames to disk

How to capture WebGL/Canvas by piping data over a websocket.

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.

Install websocketd

@TheSeamau5
TheSeamau5 / EntityComponentSystemExploration.md
Created December 29, 2014 23:16
An exploration of the Entity Component System in Elm

#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:

  • Entity : A uniquely identifiable object that may contain any number of components
  • Component : A property usually representing the raw data of one aspect of the object. (Position is a component, Velocity is a component, Strength is a component, etc...)
  • System : A continuous process performing actions on every entity that possesses a component of the same aspect as that system

To understand this, let us try to make a simple example: Boxes that move in space:

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
@jfromaniello
jfromaniello / gist:4087861
Last active February 6, 2022 03:53
socket-io.client send the cookies!
/*
* 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
@payload
payload / share.sh
Created January 26, 2012 23:46 — forked from astro/share.sh
Quick Sharing On The Local Chaos Bay
#!/bin/bash -e
URL=http://chaosbay.hq.c3d2.de
if [ -z "$1" ]; then
echo "Usage: $0 <file/dir>"
exit 2
fi
if [ -x "$(which mktorrent)" ]; then
@astro
astro / share.sh
Created January 26, 2012 23:23
Quick Sharing On The Local Chaos Bay
#!/bin/bash -e
URL=http://chaosbay.hq.c3d2.de
if [ -z "$1" ]; then
echo "Usage: $0 <file/dir>"
exit 2
fi
if [ -x $(which mktorrent) ]; then