Skip to content

Instantly share code, notes, and snippets.

View bobbbay's full-sized avatar
🐤
Learning to fly

Bob bobbbay

🐤
Learning to fly
View GitHub Profile
@CrockAgile
CrockAgile / float_arcade.md
Last active December 27, 2022 00:47
Floating Point Arcade

Floating Point Arcade

![Twitter Follow][twitter]

A Shady Coin Toss

A shady game master approaches...

Hey there! You look like you would enjoy a good game of chance.
@tothi
tothi / usbgadget_razer.sh
Created August 22, 2021 09:52
Razer USB gadget on Android for Local Privilege Escalation on Windows
# MINIMAL USB gadget setup using CONFIGFS for simulating Razer Gaming HID
# devices for triggering the vulnerable Windows Driver installer
# credits for the Windows Driver install vuln: @j0nh4t
#
# https://twitter.com/j0nh4t/status/1429049506021138437
# https://twitter.com/an0n_r0/status/1429263450748895236
#
# the script was developed & tested on Android LineageOS 18.1
@fern9001
fern9001 / nixos-vim-guide.md
Last active November 9, 2024 11:57
Fern's NixOS Vim Guide

Fern's NixOS Vim Guide

A newbie friendly guide to configuring Vim in NixOS

File Structure

Create the following file struture in /etc/nixos

/etc/nixos
    |-- apps
        |-- vim
            |-- default.nix 
            |-- vimPlugins.nix
@passcod
passcod / CARETAKERS.md
Last active December 29, 2021 17:28
Caretaker maintainership in a nutshell

Caretaker Maintainership

(If this file is included in a project, you can find the list of current caretakers at the bottom.)

In a small classical open-source project, maintainers do a lot, and if maintainers don't have time to do a lot, usually the project stalls. Finding new maintainers is hard because few people actively want to take over all the responsibilities of a project. There must be a different way.

With Caretaker Maintainership, "Maintainers" become "Caretakers". Caretakers' only mandatory responsibility is to grant Releasers commit and publish access to the project.

@rksm
rksm / init.el
Created February 7, 2021 20:16
shackle
(defun rk/open-compilation-buffer (&optional buffer-or-name shackle-alist shackle-plist)
"Helper for selecting window for opening *compilation* buffers."
;; find existing compilation window left of the current window or left-most window
(let ((win (or (loop for win = (if win (window-left win) (get-buffer-window))
when (or (not (window-left win))
(string-prefix-p "*compilation" (buffer-name (window-buffer win))))
return win)
(get-buffer-window))))
;; if the window is dedicated to a non-compilation buffer, use the current one instead
(when (window-dedicated-p win)
alias ..='cd ..'
alias ...='cd ../../../'
################################################
# [bash - aliasing cd to pushd - is it a good idea? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/4291/187865)
# You can then navigate around on the command-line a bit like a browser.
# - cd changes the directory.
# - back goes to the previous directory that you cded from.
# - flip will move between the current and previous directories without popping them from the directory stack.
@mintyleaf
mintyleaf / pv.sh
Last active April 19, 2023 19:52
lf (maybe ranger too) media w3m-img preview script
#!/usr/bin/env bash
# based on github.com/gokcehan/lf/wiki/Previews
# thanks to dylanaraps for bash bible
# a margin in pixels needed to prevent image from overlapping top title
SAFE_MARGIN=56
# a threshhold for upscaling images, like pixelart or so
NOFILTER_THRESH=256
@balsoft
balsoft / call-crate.nix
Last active August 24, 2021 21:40
Build crates with nix
{ stdenv, buildRustCrate, fetchurl, lib, defaultCrateOverrides }:
{ src, overrides ? { }, features ? [ "default" ]
, builtin ? [ "core" "compiler_builtins" ], cargoToml ? src + "/Cargo.toml"
, cargoLock ? src + "/Cargo.lock", local ? true }:
let
project = builtins.fromTOML (builtins.readFile cargoToml);
projectLock = builtins.fromTOML (builtins.readFile cargoLock);
packages = builtins.foldl' (a: n:
a // {
@jeremy-rifkin
jeremy-rifkin / stringf.cpp
Last active September 14, 2024 21:23
c++ string formatting
#include <assert.h>
#include <string>
template<typename... T> std::string stringf(T... args) {
int length = snprintf(0, 0, args...);
if(length < 0) assert(("invalid arguments to stringf", false));
std::string str(length, 0);
snprintf(str.data(), length + 1, args...);
return str;
}
@LukeMathWalker
LukeMathWalker / audit.yml
Last active November 11, 2024 17:20
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit: