Skip to content

Instantly share code, notes, and snippets.

@soulthreads
soulthreads / ShadertoyFFT.md
Last active November 23, 2023 09:57
Some details on Shadertoy FFT

Shadertoy exposes audio through a 512x2 texture, where the first row is the spectrum, and second row is wave data.

Pixel format is GL_RED GL_UNSIGNED_BYTE, meaning that each pixel contains only one 8-bit channel.

According to this shader from iq the audio in the browser is supposed to have a samplerate of 48kHz, but as it turns out, that's not the case: most likely it will be in 44.1kHz.

from androidhelper import Android
from time import sleep
import json
import urllib2
d = Android()
url = "youserver/sms/notify"
while(True):
messages = d.smsGetMessages(False)
for i in messages.result:
@tomokishii
tomokishii / mnist_cnn_bn.py
Last active December 14, 2023 03:55
MNIST using Batch Normalization - TensorFlow tutorial
#
# mnist_cnn_bn.py date. 5/21/2016
# date. 6/2/2017 check TF 1.1 compatibility
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
@terrydang
terrydang / install_nvidia_driver_in_ubuntu1604.md
Last active August 8, 2022 09:31
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@cooperaj
cooperaj / gist:10965258
Created April 17, 2014 08:38
Arduino 9dof
/*****************************************************************
LSM9DS0_AHRS.ino
SFE_LSM9DS0 Library AHRS Data Fusion Example Code
Jim Lindblom @ SparkFun Electronics
Original Creation Date: February 18, 2014
https://github.com/sparkfun/LSM9DS0_Breakout
Modified by Kris Winer, April 4, 2014
The LSM9DS0 is a versatile 9DOF sensor. It has a built-in
1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.