Skip to content

Instantly share code, notes, and snippets.

View orhun's full-sized avatar
:shipit:
I don't have a rat under my hat

Orhun Parmaksız orhun

:shipit:
I don't have a rat under my hat
View GitHub Profile
#!/usr/bin/env bash
# Author: rukh-debug
# Date: 2025 Feb 16
# https://github.com/orhun/rustypaste <3
# This script is a very minimal UI for rustyPaste server - built for poweruser.
# demo: https://i.postimg.cc/MHXFPdCq/image.png
@sassman
sassman / flamegraph-pr.yml
Created December 15, 2024 21:53
GitHub Action for flamegraphs on PR as comment
name: Flamegraph PR
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
@thesamesam
thesamesam / xz-backdoor.md
Last active March 12, 2025 15:55
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@OrionReed
OrionReed / dom3d.js
Last active February 17, 2025 22:17
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@sunshowers
sunshowers / wrap.rs
Created September 28, 2023 20:32
ratatui wrapping with textwrap
// MIT License
//
// Copyright (c) 2023 Oxide Computer Company
//
// 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:
@srd424
srd424 / fzf_readline.c
Created September 9, 2023 10:54
Terrible hack for preloading custom readline functions
/* gcc -Wall -fPIC -shared -o fzf_readline.so fzf_readline.c -ldl */
/* a much nastier version of https://github.com/lincheney/rl_custom_function,
* but works with readline in Debian/Ubuntu
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@quad
quad / 0-modular-errors-with-rusts-thiserror.md
Last active February 9, 2025 00:31
Modular Errors with Rust's thiserror

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@andrewrk
andrewrk / build.zig
Created February 20, 2023 16:20
sprinkling a little zig into a C project to help with debugging
const std = @import("std");
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard optimization options allow the person running `zig build` to select
@hnakamur
hnakamur / bounded_array_example.zig
Created February 17, 2023 23:55
Zig BoundedArray example
// Zig version: 0.10.1
// Import the standard library.
const std = @import("std");
// Define MyBoundedArray type.
const maxLength = 32;
const MyBoundedArray = std.BoundedArray(u8, maxLength);
/// Takes a slice as a parameter and fills it with a message.
#!/usr/bin/env bash
(
for lib in $(pacman -Qql openssl | grep -o '[^/]*.so$'); do
for repo in core extra community testing community-testing multilib multilib-testing staging community-staging multilib-staging gnome-Unstable kde-unstable; do
sogrep $repo $lib
done
done
) | sort -u