Skip to content

Instantly share code, notes, and snippets.

View AlexZ005's full-sized avatar
💭
What's happening?

AlexZ005

💭
What's happening?
View GitHub Profile
@AncientJames
AncientJames / pixelmap.py
Created February 28, 2025 02:14
This is the TPC I used to pixel map the Fibrovisor ( https://www.youtube.com/watch?v=zz59e1wWyVc ). It uses rgbmatrix ( https://github.com/hzeller/rpi-rgb-led-matrix ) to light up one pixel at a time, and opencv to record the position of the brightest spot in the frame.
#!/usr/bin/env python
import time
import sys
import getpass
from rgbmatrix import RGBMatrix, RGBMatrixOptions
import cv2 as cv
options = RGBMatrixOptions()
options.hardware_mapping = 'regular'
@tadev
tadev / ytplaylist.py
Last active December 29, 2022 03:37
script to get a youtube mix auto playlist using youtube-dl
#!/usr/bin/env python3
'''
Outputs a youtube playlist, one link per line
If a playlist link is passed as a parameter, it outputs all the links contained in that playlist.
If a search string is passed, it downloads an auto-generated Youtube Mix playlist for the first result of that search term.
If a single Youtube video link is passed, it downloads an auto-generated Youtube Mix playlist for that link.
This script can be piped directly to a player that supports youtube such as mpv
Examples:
@TheCherno
TheCherno / Instrumentor.h
Last active October 17, 2025 07:36
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@rrgarciach
rrgarciach / Dockerfile
Created June 11, 2018 04:09
Go HTTP server example
FROM golang:alpine
ADD ./src /go/src/app
WORKDIR /go/src/app
ENV PORT=3001
CMD ["go", "run", "main.go"]
@ytn86
ytn86 / cl_platform.c
Last active November 7, 2019 04:09
show OpenCL device list
#include <stdio.h>
#include <CL/cl.h>
#define MAX_PLATFORM_SIZE 256
#define MAX_DEVICE_SIZE 256
int main()
{
cl_device_id devices[256];
@bryik
bryik / README.md
Last active January 18, 2020 17:15
`dev_appserver.py: error: too few arguments`

2017-07-16

dev_appserver.py: error: too few arguments

I encountered this error shortly after installing the Google Cloud SDK. It made no sense, I was in the correct directory and entered the same command as usual:

dev_appserver.py app.yaml
@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@ruby0x1
ruby0x1 / main.cpp
Last active January 4, 2019 21:09
SDL2 sample
//SDL2 flashing random color example
//Should work on iOS/Android/Mac/Windows/Linux
#include <SDL.h>
#include <SDL_opengl.h>
#include <stdlib.h> //rand()
static bool quitting = false;
static float r = 0.0f;
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a