Skip to content

Instantly share code, notes, and snippets.

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0
Nick Fox-Gieg / @n1ckfg / fox-gieg.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
await loadScript("https://unpkg.com/latk@1.0.3/latk.js")
p = new P5({mode: 'WEBGL'}) // loads p5js library, comment this line after using it once
p.hide() // hide p5js canvas.
currentFrame = 0
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: black;
}
</style>
<script src="https://unpkg.com/p5@1.9.1/lib/p5.min.js"></script>
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0
Nick Fox-Gieg / @n1ckfg / fox-gieg.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
p = new P5({width: 500, height: 500, mode: 'WEBGL'}) // loads p5js library, comment this line after using it once
p.hide() // hide p5js canvas.
polylines = []
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0
Nick Fox-Gieg / @n1ckfg / fox-gieg.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
p = new P5({mode: 'WEBGL'}) // loads p5js library, comment this line after using it once
p.hide() // hide p5js canvas.
rot = 0
rotDelta = 0
#!/bin/sh
# https://github.com/greymechanic/loopVideo
# clear terminal text, set background to black, and hide the cursor
setterm -cursor off
setterm -term linux -background black
setterm -term linux clear
# this is the path to the directory containing your videos
VIDEOPATH="/home/pi/Videos"
@n1ckfg
n1ckfg / JetsonNanoTensorFlowBuildGPU.md
Created April 16, 2024 19:15 — forked from sdeoras/JetsonNanoTensorFlowBuildGPU.md
Building TensorFlow C-library for Nvidia Jetson Nano

Steps to build TensorFlow v1.12.0 C-library on Jetson Nano for GPU

Jetson Nano configuration

  • ARM 64 (aarch64)
  • gcc 7.3
  • cuda 10
  • cudnn 7

TensorFlow configuration

  • v1.12.0
@n1ckfg
n1ckfg / camera.py
Created April 15, 2024 16:00 — forked from pghazanfari/camera.py
numpy Perspective Projection + Look At Matrices
import numpy as np
def perspective_fov(fov, aspect_ratio, near_plane, far_plane):
num = 1.0 / np.tan(fov / 2.0)
num9 = num / aspect_ratio
return np.array([
[num9, 0.0, 0.0, 0.0],
[0.0, num, 0.0, 0.0],
[0.0, 0.0, far_plane / (near_plane - far_plane), -1.0],
[0.0, 0.0, (near_plane * far_plane) / (near_plane - far_plane), 0.0]
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0
Nick Fox-Gieg / @n1ckfg / fox-gieg.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
await loadScript("https://unpkg.com/latk@1.0.3/latk.js")
latk = Latk.read("https://raw.githubusercontent.com/LightningArtist/latk-test-files/main/latk_logo.latk")
p = new P5({mode: 'WEBGL'}) // loads p5js library, comment this line after using it once
import csv
with open("tiltset_credits_unique_13908_cleaned.csv", "r") as file:
csv_reader = csv.reader(file)
extra_comma_counter = 0
for i, line in enumerate(csv_reader):
num_commas = len(line) - 1
if (num_commas > 1):
@n1ckfg
n1ckfg / check_gpu.py
Created October 4, 2023 13:20
check_gpu.py
import torch
import onnxruntime as ort
torch.cuda.is_available() # Nvidia or AMD GPU
torch.backends.mps.is_available() # Apple GPU
ort.get_device() # any GPU