Skip to content

Instantly share code, notes, and snippets.

View zrzka's full-sized avatar
👓
Trying to do something

Robert Vojta zrzka

👓
Trying to do something
View GitHub Profile
@zrzka
zrzka / init.el
Last active February 7, 2024 07:22
W/ address sanitizer
;; Related savehist config
(use-package savehist
:hook (after-init . savehist-mode)
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
history-length 1000
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
@zrzka
zrzka / bt.txt
Created February 6, 2024 18:39
Yet another one
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xb9400409b9400c08)
* frame #0: 0x0000000100381918 emacs`c_strcasecmp(s1="", s2="thin") at c-strcasecmp.c:39:23
frame #1: 0x000000010026dbe0 emacs`xstrcasecmp(a="", b="thin") at dispextern.h:91:10
frame #2: 0x000000010026d54c emacs`font_style_to_value(prop=FONT_WEIGHT_INDEX, val=0x000000013d323e50, noerror=true) at font.c:375:10
frame #3: 0x0000000100273fc4 emacs`font_select_entity(f=0x000000014b9e2a30, entities=0x000000012e3b4a93, attrs=0x000000014b717930, pixel_size=0, c=-1) at font.c:2943:5
frame #4: 0x0000000100273b88 emacs`font_find_for_lface(f=0x000000014b9e2a30, attrs=0x000000014b717930, spec=0x000000014b8e5065, c=-1) at font.c:3104:15
frame #5: 0x0000000100319004 emacs`fontset_find_font(fontset=0x000000012e847cf5, c=9207, face=0x000000014b717930, charset_id=-1, fallback=false) at fontset.c:660:18
frame #6: 0x00000001003134a8 emacs`fontset_font(fontset=0x000000014dfea6d5, c=9207, face=0
@zrzka
zrzka / bt.txt
Created February 6, 2024 15:51
Font face crash
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
* frame #0: 0x00000001000cde08 emacs`lface_hash(v=0x0000000000000000) at xfaces.c:4434:41 [opt]
frame #1: 0x00000001000cdcb8 emacs`face_for_font(f=0x0000000131183230, font_object=0x0000000122716405, base_face=0x0000000000000000) at xfaces.c:4932:10 [opt]
frame #2: 0x00000001001e7a88 emacs`face_for_char(f=0x0000000131183230, face=0x00000001306818a0, c=<unavailable>, pos=<unavailable>, object=<unavailable>) at fontset.c:1014:14 [opt]
frame #3: 0x00000001001835ec emacs`Finternal_char_font [inlined] FACE_FOR_CHAR(f=0x0000000131183230, face=<unavailable>, character=9207, pos=-1, object=0x0000000000000000) at dispextern.h:1911:10 [opt]
frame #4: 0x00000001001835d8 emacs`Finternal_char_font(position=<unavailable>, ch=<unavailable>) at font.c:4521:13 [opt]
frame #5: 0x00000001001ac550 emacs`exec_byte_code(fun=<unavailable>, args_template=<unavailable>, nargs=<unavailable>, args=<unavailable>) at byte
@zrzka
zrzka / rv-org.el
Created February 2, 2024 12:36
Capture todo
(defun rv/mu4e-message-contact-field-join (field property)
"Join mu4e message contact field PROPERTY values."
(string-join
(delq nil (mapcar (lambda (x) (plist-get x property)) field)) ", "))
(defun rv/mu4e-message-org-properties (message)
"Make a list of properties for a todo.
Return a list of `(cons NAME VALUE)'."
(let ((current-prefix-arg nil))
class ClipView: NSClipView {
var isScrollAnimationEnabled: Bool = true
override func scroll(to newOrigin: NSPoint) {
if isScrollAnimationEnabled {
super.scroll(to: newOrigin)
} else {
setBoundsOrigin(newOrigin)
}
}
// Finder like two levels
import Cocoa
class ViewController: NSViewController {
@IBOutlet var outlineView: NSOutlineView?
let data = [
Node(1, "Group A", true, [
Node(11, "A 1"),
@zrzka
zrzka / colors-blue.txt
Last active June 16, 2020 11:13
macOS Catalina colors
ColorList: Apple
0.000000 0.000000 0.000000 1.000000 Black
0.016804 0.198351 1.000000 1.000000 Blue
0.667998 0.475121 0.258601 1.000000 Brown
0.000000 0.991439 1.000000 1.000000 Cyan
0.000000 0.976805 0.000000 1.000000 Green
1.000000 0.252792 1.000000 1.000000 Magenta
1.000000 0.576372 0.000000 1.000000 Orange
0.579194 0.128014 0.572686 1.000000 Purple
1.000000 0.149131 0.000000 1.000000 Red
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)monitorMouseLocationNSEvent {
void (^printMouseLocation)(NSString *, NSEvent *) = ^(NSString *type, NSEvent *event) {
//
// Copyright © 2020 Robert Vojta. All rights reserved.
//
#import "ViewController.h"
@interface UIView(ColorAtPoint)
- (UIColor *)colorAt:(CGPoint)point;
@zrzka
zrzka / ContentView.swift
Created May 19, 2020 10:15
TrackPadView with touches
import SwiftUI
import AppKit
protocol AppKitTouchesViewDelegate: AnyObject {
// Provides `.touching` touches only.
func touchesView(_ view: AppKitTouchesView, didUpdateTouchingTouches touches: Set<NSTouch>)
}
final class AppKitTouchesView: NSView {
weak var delegate: AppKitTouchesViewDelegate?