Skip to content

Instantly share code, notes, and snippets.

View misiek08's full-sized avatar
😁
Hacking for performance and less resources usage!

Michał Idzikowski misiek08

😁
Hacking for performance and less resources usage!
View GitHub Profile
@misiek08
misiek08 / App.tsx
Created November 7, 2024 18:13
ReactFlow add node when edge dropped nowhere, like UE
import { useState, useCallback, useRef } from 'react';
import {
ReactFlow,
addEdge,
MiniMap,
Controls,
Background,
useNodesState,
useEdgesState,
useReactFlow,
@misiek08
misiek08 / ffmpeg_opt.c
Created June 27, 2024 17:06
[WIP] ffmpeg open files in parallel
struct open_file_args {
OptionGroup *optG;
Scheduler *sch;
const char *inout;
int (*func)(const OptionsContext*, const char*, Scheduler*);
};
void *threaded_open_file(void *data);
static int open_files2(OptionGroupList *l, const char *inout, Scheduler *sch,
int (*open_file)(const OptionsContext*, const char*,
@misiek08
misiek08 / css2
Last active June 21, 2024 12:30
Uploader ESL Electronic Shelf Label (slight play with rotation of text, fork of https://github.com/atc1441/ATC_GICISKY_ESL)
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@misiek08
misiek08 / alternative_input.c
Created February 14, 2024 00:53
ffmpeg alternative input switching from [email protected] patch
/*
* Copyright (c) 2018 Bodecs Bela
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@misiek08
misiek08 / ffmpeg.md
Created April 15, 2019 17:40 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@misiek08
misiek08 / 0-README.md
Created December 6, 2018 23:40 — forked from Overbryd/0-README.md
Cloudflare Fragment Caching

Cloudflare fragment rendering/caching

This worker script will evaluate your origin response, and replace html comments marked as fragment:key with a respective prefetch defined in a X-Fragments response header.

Usage

Your origin must include the X-Fragments header, specifying the a comma separated list of prefetch requests to make for that response.

< HTTP/1.1 200 OK
@misiek08
misiek08 / gist:fd01946136c149a3e7950a9152fc4fb5
Created October 18, 2017 19:40
basic, incomplete regex for parsing html tag arguments
\b([^\s=]+)=("((?:[^"\\]+(?:\\")?)+)"|'((?:[^'\\]+(?:\\')?)+)')
@misiek08
misiek08 / gist:90efd270e275732033dc
Created January 25, 2015 16:33
openresty build for debian v2
apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make libgeoip-dev
./configure --with-http_realip_module --with-http_addition_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_iconv_module -j10 --user=www-data --group=www-data --with-file-aio --with-ipv6
make
make install
@misiek08
misiek08 / gist:7988b3b9a9911e35d0b3
Created August 10, 2014 11:02
PHP class for parsing HTTP multipart/form-data request body
<?php
class HttpMultipartParser
{
public function parse_multipart($stream, $boundary = null)
{
$return = array('variables' => array(), 'files' => array());
$partInfo = null;
SELECT * FROM bought_items bi JOIN items i ON (i.id = bi.item_id) WHERE i.title LIKE %% OR username LIKE %%