Skip to content

Instantly share code, notes, and snippets.

View furryablack's full-sized avatar

Aleksei Kosianov furryablack

  • Armenia
View GitHub Profile
@furryablack
furryablack / phone-web-cam-on-linux.sh
Last active December 15, 2023 04:30
Use your phone like a webcam in your linux env
# STEP 1
# Install deps
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
# STEP 2
# Create fake webcam dummy device
# It will be used like a stream source in third-party programs like Zoom, Skype, etc
sudo modprobe v4l2loopback card_label="Fake Webcam" exclusive_caps=1
@furryablack
furryablack / up-stream-to-device.sh
Created January 14, 2022 12:19
Smartphone streams video. Turn it into virtial device by gst.
modprobe -r v4l2loopback
modprobe v4l2loopback exclusive_caps=1
ls /dev/video*
gst-launch-1.0 souphttpsrc location="http://admin:admin@192.168.0.100:4201/videofeed" do-timestamp=true is-live=true ! multipartdemux ! jpegdec ! videoconvert ! v4l2sink device="/dev/video0"
@furryablack
furryablack / load-process-env.ts
Last active November 7, 2021 05:06
Vite, loadEnv, process.env[VARS] in the vite.config
/*
loadProcessEnv function is setting process.env vars accessible in the vite.config and parse process.env vars.
(string process.env.FLAG="true" => boolean process.env.FLAG=true)
*/
// @file: .env
VITE_NEED_MINIFY=true
// @file: load-process-env.ts
@furryablack
furryablack / composition-api.ts
Created March 4, 2021 13:37
Vue composition api measurements
/*
* @file: use-state.h.ts
*/
import {Ref} from "vue";
export type DispatchFn<T> = (nextValue: T) => void
export type ResetFn = () => void
export type State = object | number | string | boolean | null;
export type MapFn<T> = (currentValue: T, nextValue: T) => T