Skip to content

Instantly share code, notes, and snippets.

# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
@kunofellasleep
kunofellasleep / gaussianBlur.js
Created May 21, 2019 05:54
Gaussian Blur on Spark AR
// Created by @kunofellasleep on 2019/05/20.
//Modules
const Diagnostics = require('Diagnostics');
const Materials = require('Materials');
const Textures = require('Textures');
const CameraInfo = require('CameraInfo');
const Shaders = require('Shaders');
const R = require('Reactive');
@bogdan-kulynych
bogdan-kulynych / install-cuda-10-bionic.sh
Last active December 5, 2023 10:26
Install CUDA 10 on Ubuntu 18.04
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
@warrenm
warrenm / Shapes.metal
Created July 22, 2018 09:25
Drawing 2D shapes with Metal
#include <metal_stdlib>
using namespace metal;
struct VertexIn {
float2 position [[attribute(0)]]; // varies per-vertex
float4 color [[attribute(1)]]; // varies per-instance
float3 center [[attribute(2)]]; // varies per-instance
float radius [[attribute(3)]]; // varies per-instance
};
@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 4, 2024 14:18
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@korakot
korakot / colab_download.py
Created November 15, 2017 08:40
Google colab file upload/download
files.download('example.txt') # from colab to browser download
@j-j-m
j-j-m / commonprofile.metal
Created May 8, 2017 00:20
Can't access GL Uniforms in Metal shader modifier? Apple docs for SCNShadable written in terms of GL? Pulling your hair out?... this will help.
////////////////////////////////////////////////
// CommonProfile Shader v2
#import <metal_stdlib>
using namespace metal;
#ifndef __SCNMetalDefines__
#define __SCNMetalDefines__
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 4, 2024 12:46
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@mattdesl
mattdesl / billboard.glsl
Created January 18, 2017 22:52
billboarding in GLSL
attribute vec3 position;
uniform mat4 modelViewMatrix;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
uniform float scale;
uniform float size;
uniform float aspect;
varying vec2 vUv;
@julien
julien / metaballs.glsl
Created October 29, 2016 12:24
simple metaball shader
precision highp float;
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
float ball(vec2 p, float fx, float fy, float ax, float ay) {
vec2 r = vec2(p.x + sin(time * fx) * ax, p.y + cos(time * fy) * ay);
return 0.09 / length(r);
}