Skip to content

Instantly share code, notes, and snippets.

@ethan-leba
ethan-leba / readme.org
Last active August 16, 2024 12:04
Yabai + Emacs seamless window movement

Yabai + Emacs window movement integration

This is a short guide to setting up unified window movement bindings with Yabai + SKHD and Emacs, inspired by this tmux-vim movement guide. Short video demo here.

For example, if there’s if Emacs is in focus and there’s an Emacs window to the left, then that window will be focused with the binding. Otherwise, the next application to the left will be focused. In this guide I’m using alt - HJKL, but you can substitute those with whatever you’d like.

@alexhude
alexhude / ImHex.diff
Last active July 4, 2024 18:20
Build ImHex for macOS
diff --git a/source/helpers/crypto.cpp b/source/helpers/crypto.cpp
index fa23428..e0ef3ad 100644
--- a/source/helpers/crypto.cpp
+++ b/source/helpers/crypto.cpp
@@ -41,7 +41,7 @@ namespace hex {
std::array<u8, 512> buffer = { 0 };
for (u64 bufferOffset = 0; offset < size; offset += buffer.size()) {
- const u64 readSize = std::min(buffer.size(), size - bufferOffset);
+ const u64 readSize = std::min((u64)buffer.size(), size - bufferOffset);
@muff-in
muff-in / resources.md
Last active October 17, 2024 22:10
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@max-rocket-internet
max-rocket-internet / prom-k8s-request-limits.md
Last active November 11, 2024 08:40
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
@clemera
clemera / mode-line+.el
Last active August 20, 2023 01:26
mode-line+
;;; -*- lexical-binding: t; -*-
;; doom-mode-line > mood-line > mode-line+
;; * Deps
(defvar anzu--state nil)
(defvar multiple-cursors-mode nil)
(declare-function flycheck-count-errors "ext:flycheck" (errors))
(declare-function anzu--update-mode-line "ext:anzu" ())
(declare-function mc/num-cursors "ext:multiple-cursors" ())
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active November 16, 2024 10:38
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@rubencaro
rubencaro / setup_go.md
Last active April 28, 2024 21:52
Golang installation guide

Golang installation guide

Since Golang version 1.11 this process is finally (almost) as easy as it should (!!). You can see full docs here. For older guides see here.

These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.

Installing everything needed the first time

Install asdf and its golang plugin, then install golang

@zacharycarter
zacharycarter / wclwn.md
Last active August 19, 2024 03:44
Binding to C Libraries with Nim
@so0k
so0k / kubectl.md
Last active September 11, 2024 08:36
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of