Skip to content

Instantly share code, notes, and snippets.

View Miqueas's full-sized avatar
👍
Average nerd

Miqueas Miqueas

👍
Average nerd
View GitHub Profile
@Miqueas
Miqueas / README.md
Last active August 25, 2025 16:24
[C + Gio] Subprocess

GSubprocess examples in C.

Quick start:

// Build command: gcc -o gsubprocess gsubprocess.c `pkgconf --cflags --libs gio-2.0`
#include <gio/gio.h>

int
main(int argc, char** argv)
{
@Miqueas
Miqueas / README.md
Last active August 27, 2025 20:50
[Fish] Personal FFMPEG wrapper

I daily drive this FFMPEG wrapper to compress videos and, at least in my experience, is very effective but not perfect. In most cases it should be able to compress from 98% to 70% of the video file size, maybe less, maybe more. I guess it all depends on the video itself and/or how powerful your CPU is. For my use case, it's enough, but I still keep modifying every now and then trying to achieve the best balance between: compression time, file size and perceived quality. If you found any improvements in those aspects, feel free to share them in the comments. I wanna clarify I'm not an expert on this topic, I just started testing out stuff with help of AI and eventually got to this point.

minify-video.fish:

function _show_help
  echo 'Usage: minify-video [OPTIONS] [FILES...]'
  echo 'Options:'
  echo '  -h,  --help       Show this help message'
  echo '  -y,  --yes        Don\'t ask for confirmations'
  echo '  -p,  --preset     Set the encoding preset (default: veryfast)'
@Miqueas
Miqueas / README.md
Last active September 9, 2024 02:39
[Flutter] Custom Dropdown

Custom Dropdown

Learning how to use OverlayPortal and CompositedTransformTarget to build a custom dropdown in Flutter without external packages!

This is part of an article I wrote in DEV.to, go check it out! :)

Cover

@Miqueas
Miqueas / README.md
Last active June 17, 2024 05:05
Custom radio button in Flutter

Custom radio button in Flutter

image

@Miqueas
Miqueas / README.md
Last active June 23, 2024 23:30
Basic audio waveform in Flutter

Basic audio waveform in Flutter

A simple example I made while learning about custom paints in Flutter with CustomPaint and CustomPainter.

This is part of an article I wrote in DEV.to and Medium, check them out!

image

@Miqueas
Miqueas / README.md
Last active June 15, 2024 00:55
OverflowBox and videos in Flutter

OverflowBox and videos in Flutter

This is part of an article I originally wrote in Medium, but it's also available in DEV.to, check it out!

image

@Miqueas
Miqueas / appendQuery.nim
Created March 15, 2022 14:40
[Nim] Simple operator for `Uri` to help append queries
import std/uri
proc `?+`*(url: Uri, ql: openArray[tuple[string, string]]): Uri =
var qs = @ql
if url.query.len() != 0:
for k, v in url.query.decodeQuery():
qs.add( (k, v) )
return url ? qs
@Miqueas
Miqueas / utils.lua
Last active March 8, 2022 15:59
[Lua] Small set of some OS and filesystem utilities
-- Determines if this script is running on Windows
os.is_win = package.config:sub(1, 1) == "\\"
-- Return the path to the temp dir
function os.get_temp_dir()
if os.is_win then
-- Windows. Same as:
-- os.getenv("TEMP")
-- os.getenv("TMP")
return os.getenv("UserProfile") .. "/AppData/Local/Temp"
@Miqueas
Miqueas / Gtk4Example.nim
Created October 16, 2021 04:01
[Nim] Simple GTK 4 example
import gintro/gobject
import gintro/gio
import gintro/gtk4
proc activate(app: gtk4.Application) =
let win = gtk4.newApplicationWindow(app)
win.defaultSize = (800, 600)
win.present()
let app = gtk4.newApplication("org.gtk.example")
@Miqueas
Miqueas / arrays.c
Last active October 5, 2025 02:20
[C] Cursed or interesting?
#include <stdio.h>
int main(void) {
// So apparently arrays in C are just pointers, which means
// they basically points to the address of the first element
// and when we index them using the `[]` syntax, we're just
// performing an addition on that address and the syntax
// itself doesn't seem to matter that much either.
int arr[4] = { 2, 4, 6, 8 };
// This will print the first element (2)