Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@joshkay
joshkay / DataTable.tsx
Created May 21, 2024 18:39
TanStack cell selection
"use client";
import {
type ColumnDef,
flexRender,
getCoreRowModel,
useReactTable,
getPaginationRowModel,
getSortedRowModel,
getFilteredRowModel,
@Ephraim-Bryski
Ephraim-Bryski / client.js
Last active June 25, 2025 17:52
reading and writing files in electron
const FILE_A = 'a.json'
const FILE_B = 'b.json'
const files = [FILE_A,FILE_B]
const contents = {}
window.api.receive("sendReadContent", (file_name,data) => {
@srestraj
srestraj / frame-extractor.md
Last active June 11, 2025 18:01
Extract video frame from a file input using JS and Canvas
Create an input element to let users upload a video
<label for="file">Upload Video</label> 
<input type="file" accept=".mp4, .mkv, .mpeg4" id="file" class="video-input">
<button class="capture-btn">Capture</button>
<div class="source-vid"></div>
<div class="result"></div>
@red-dragon65
red-dragon65 / Deck ui.md
Last active February 21, 2024 16:26
How to properly run Steam Decks UI on Manjaro

This guide is deprecated! Please take a look at the alternative solutions below.

This guide was created to run the steam deck ui on a linux desktop before valve officially updated big picture mode for the steam client. This guide no longer serves any purpose.

Big Picture Mode

  • The steam client now officially uses the steam deck ui (gamepad ui) for big picture mode.

HoloISO

  • A reversed engineered version of valves steam deck OS
@MichaelPHolstein
MichaelPHolstein / script.js
Last active April 18, 2023 17:29
JavaScript file of background removal using Tensorflow and bodyPix
IMAGE_SRC = './img/8.jpg'
const loadImage = () => {
const img = new Image()
img.src = IMAGE_SRC
const canvas = document.querySelector('canvas')
const ctx = canvas.getContext('2d')
img.addEventListener('load', () => {
// Original code by Homer Chen
// https://github.com/homerchen19/use-undo
// Same as original but using useState instead of useReducer
import { useState, useCallback } from 'react';
const initialState = {
past: [],
present: null,
@johnhutchins
johnhutchins / middleNumberInBetweenTwoNumbers.js
Created October 8, 2019 18:06
Get the middle number between two numbers.
function middleInBetweenNumnbers(min, max) {
return Math.floor((max+min)/2);
}
@jeffposnick
jeffposnick / service-worker.js
Created September 20, 2019 00:56
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
@nikolayemrikh
nikolayemrikh / bash.sh
Last active January 3, 2025 12:37
Calculate SHA-1 hash GitHub API v3 way
git hash-object ./file
# or
git hash-object -t blob
# or
cat ./file | git hash-object --stdin