Skip to content

Instantly share code, notes, and snippets.

View thierry-FreeBSD's full-sized avatar

Thierry Thomas thierry-FreeBSD

View GitHub Profile
@lcheylus
lcheylus / nvim_init.lua
Created October 8, 2025 16:35
Minimal configuration file for Neovim
-- Minimal configuration file for Neovim
-- Check if needed commands are available
local function is_command_available(cmd)
-- os.execute returns true (or exit code 0) if the command exists
local result = os.execute('command -v ' .. cmd .. ' >/dev/null 2>&1')
-- Lua 5.2+ returns true on success, or nil/false on failure
-- Lua 5.1 returns status code shifted left (e.g., 0 = success)
if result == true or result == 0 then

Vim Manipulation Cheat Sheet

Action

Key Result
v select
y copy (yank)
c change
d delete
@katef
katef / plot.awk
Last active November 3, 2025 23:57
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@katef
katef / life-utf8.c
Last active September 8, 2024 05:59
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*
#define _GNU_SOURCE
#include <assert.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
@JeremyMorgan
JeremyMorgan / workstationsetup.sh
Last active September 18, 2024 16:57
Setup for my FreeBSD Workstation
# This may be runnable as a script, but keep in mind -y is not always acknowledged.
# These are the drop dead basics
pkg -y install vim
pkg -y install git
pkg -y install chromium
pkg -y install gimp
pkg -y install sudo
# Install Rust
@RichardBronosky
RichardBronosky / README.MD
Last active December 5, 2025 04:01
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@CodeWire
CodeWire / unixToolbox.md
Created July 23, 2016 19:00 — forked from tokhi/unixToolbox.md
Collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users.

#Unix Toolbox

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

##Unix Toolbox revision 14.4

The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: