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)
{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)
{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)'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! :)
| 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 |
| -- 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" |
| 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") |
| #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) |