Skip to content

Instantly share code, notes, and snippets.

View pa-0's full-sized avatar

Peter Abbasi pa-0

View GitHub Profile
@pa-0
pa-0 / main.rs
Created August 25, 2025 21:16 — forked from MoAlyousef/main.rs
fltk-sys example
#![feature(concat_idents)]
use fltk_sys::{fl::*, frame::*, window::*, group::*, button::{self, *}};
use std::os::raw::*;
macro_rules! fstr {
($s:literal) => {
concat!($s, "\0").as_ptr() as _
}
}
@pa-0
pa-0 / custom_dialog.rs
Created August 25, 2025 21:15 — forked from MoAlyousef/custom_dialog.rs
custom dialog using fltk-rs
use fltk::{
app, button,
enums::{Color, Font, FrameType},
frame, group, input,
prelude::*,
window,
};
fn style_button(btn: &mut button::Button) {
btn.set_color(Color::Cyan);
@pa-0
pa-0 / hover_button.rs
Created August 25, 2025 21:15 — forked from MoAlyousef/hover_button.rs
Example of Hover support for buttons, it basically requires handling the Event::Enter and Event::Leave events.
use fltk::{
app, button,
enums::{Color, Event, FrameType},
prelude::*,
window,
};
const COLOR: u32 = 0xB39DDB;
const SELECTION_COLOR: u32 = 0x9575CD;
const HOVER_COLOR: u32 = 0xD1C4E9;
@pa-0
pa-0 / resize_override.rs
Created August 25, 2025 21:02 — forked from MoAlyousef/resize_override.rs
Override FLTK's resizing defaults
#![allow(unused_variables)]
use fltk::{
app::App,
button::Button,
enums::Event,
group::Group,
prelude::{GroupExt, WidgetBase, WidgetExt, WindowExt},
window::Window,
};
@pa-0
pa-0 / popup_hack.rs
Created August 25, 2025 21:00 — forked from MoAlyousef/popup_hack.rs
A popup hack allowing to use dynamic strings, basically by creating a hidden Choice widget then getting the MenuItem using the `MenuExt::at(0)` method.
use fltk::{prelude::*, *};
fn main() {
let mut choice = menu::Choice::default();
choice.add_choice("File/New");
choice.add_choice(&format!("{}\t", "Edit/Cut"));
choice.add_choice("File/Open");
choice.add_choice(&format!("Edit/{}", "Copy"));
choice.add_choice("Other|Option");
@pa-0
pa-0 / expand_button.rs
Created August 25, 2025 20:59 — forked from MoAlyousef/expand_button.rs
Expandable button animation using fltk-rs
use fltk::{prelude::*, *};
fn main() {
let app = app::App::default();
app::set_visible_focus(false);
let mut win = window::Window::default().with_size(400, 300);
win.set_color(enums::Color::White);
let mut but = button::Button::default()
.with_size(80, 40)
.with_label("Expand!")
@pa-0
pa-0 / get-meetings.ps1
Created August 17, 2025 12:43 — forked from secretGeek/get-meetings.ps1
Get today's schedule from Outlook, using COM, and format as text for my TODO.txt file
# Get a list of meetings occurring today.
function get-meetings() {
$olFolderCalendar = 9
$ol = New-Object -ComObject Outlook.Application
$ns = $ol.GetNamespace('MAPI')
$Start = (Get-Date).ToShortDateString()
$End = (Get-Date).ToShortDateString()
$Filter = "[MessageClass]='IPM.Appointment' AND [Start] > '$Start' AND [End] < '$End'"
$appointments = $ns.GetDefaultFolder($olFolderCalendar).Items
$appointments.IncludeRecurrences = $true
@pa-0
pa-0 / trsm
Created August 11, 2025 23:03 — forked from khurshid-alam/trsm
Transmission-Shutdown-script
#!/bin/bash
#Transmission-Shutdown-Script
========
#This is the transmission shutdown script I wrote for a [askubuntu question](http://askubuntu.com/questions/202537/transmission-#shutdown-script-for-multiple-torrents) with the help of transmission RPC interface.
#**What it Does?**
@pa-0
pa-0 / transmission-daemon
Created August 11, 2025 23:00 — forked from gene1wood/transmission-daemon
transmission-daemon sysconfig file to enable binding to an interface
# /etc/sysconfig/transmission-daemon
INTERFACE=ppp0 # Set this to the interface you want the daemon to bind to
if /sbin/ifconfig $INTERFACE >>/dev/null 2>&1; then
BIND_ADDR="`/sbin/ifconfig $INTERFACE | awk '$1 == \"inet\" {print $2}' | awk -F: '{print $2}'`"
else
BIND_ADDR="127.0.0.1"
fi
@pa-0
pa-0 / README.md
Created July 13, 2025 05:48 — forked from JohannesDeml/README.md
Batch convert images with inkscape on windows

Batch convert svg|pdf|eps|emf|wmf|ai|ps|cdr to eps|pdf|png|jpg|tiff|svg|ps|emf|wmf

Screenshot Batch converter for Windows using Inkscape with the command line
InkscapeBatchConvert is an easy to use solution to quickly convert all files of a folder to another type without the need to open Inkscape. The program uses Windows Batch scripting and will only work on Windows.
Tested with Inkscape 1.0.x - 1.3.x ✅ (The last version that supports Inkscape 0.9.x can be found here)

Usage

  1. Download _InkscapeBatchConvert.bat
  2. Put it in the folder where you have files you wish to convert (will also scan on all subfolders for files of input type).
  3. Then double click the file to start it.