Skip to content

Instantly share code, notes, and snippets.

View martonlederer's full-sized avatar

Marton Lederer martonlederer

View GitHub Profile
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@martonlederer
martonlederer / README.md
Last active November 24, 2023 16:06
Hungarian Programmer Keyboard (with extra chars, like ";,{,}, etc.") for the MacBook Pro

Hungarian Keyboard Layout for MacBook programmers

An extended keyboard made for developers used to the Linux / Windows Hungarian keyboard layout.

Install

  1. Download Ukelele and the file above (hungarian-programmer-keyboard.keylayout)
  2. Open the program and create a new keyboard layout collection (File > New Keyboard Layout Collection)
  3. Load the file that you downloaded by clicking the plus sign at the bottom-left of the window and clicking "Existing File"
  4. Open the installation organizer tool (File > Install > Show Organiser)
@xavierfoucrier
xavierfoucrier / gpg-signing.md
Last active June 21, 2024 13:14
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key
@troyfontaine
troyfontaine / 1-setup.md
Last active June 29, 2024 13:29
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.