Skip to content

Instantly share code, notes, and snippets.

View pngdeity's full-sized avatar
⚙️
Takin' care of business and working overtime.

Nathan Somers pngdeity

⚙️
Takin' care of business and working overtime.
View GitHub Profile
@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@benmills
benmills / finch_notification.pl
Last active February 24, 2023 18:20
This is a finch plugin that sends notifications when new messages are received
use Purple;
use Data::Dumper;
%PLUGIN_INFO = (
perl_api_version => 2,
name => "Growl",
version => "0.1",
summary => "Use growl notification for messages.",
description => "Use growl notification for messages.",
author => "daniel\@netwalk.org",
url => "http://pidgin.im",
* me_cleaner is a shitty way to disable it because:
- PTE isn't fully disabled
- not works for everyone
- might result in crashes or only works for half hour till it restarts
- https://github.com/corna/me_cleaner
Better version:
- patches Bios code (me firmware)
- works better especially for Core i-6000, Core i-7000
- doc/research: http://blog.ptsecurity.com/2017/08/disabling-intel-me.html
@lzlrd
lzlrd / 20-makepkg.hook
Last active April 2, 2024 04:13
A Makepkg configuration for Arch Linux that utilises LLVM and takes optimisation up to eleven.
[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = etc/makepkg.conf
Target = usr/share/makepkg/buildenv/lto.sh
Target = usr/share/makepkg/executable/strip.sh
[Action]
Description = Modifying the Makepkg configuration...

Example usage:

journalctl --unit=NetworkManager --lines=500 | cut --bytes=72- | python log_markov_chain.py

The cut takes off the timestamp, so the logs actually contain verbatim repitions of some lines [A, B, C, A, ...]

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)