Skip to content

Instantly share code, notes, and snippets.

@goranmoomin
goranmoomin / emacs-xwidget.patch
Created March 25, 2020 13:51
emacs-xwidget.patch
diff --git a/configure.ac b/configure.ac
index f604acb694..2d92d4b6ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -484,7 +484,7 @@ AC_DEFUN
[with_file_notification=$with_features])
OPTION_DEFAULT_OFF([xwidgets],
- [enable use of some gtk widgets in Emacs buffers (requires gtk3)])
+ [enable use of xwidgets in Emacs buffers (requires gtk3 or macOS Cocoa)])
@goranmoomin
goranmoomin / remove-fileheader.sh
Last active July 7, 2020 09:28
Xcode remove `//__FILEHEADER__`
#!/bin/bash
grep -l FILEHEADER -R /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates | grep -v plist | while IFS= read -r file
do
sudo sed -i '' '/\/\/___FILEHEADER___/d' "$file"
done
@goranmoomin
goranmoomin / NSPopoverDelegate.swift
Created August 27, 2020 00:21
Making a window controller with a popover appearance (which didn't go into code, but might be useful in the future)
func detachableWindow(for popover: NSPopover) -> NSWindow? {
let windowController = NSStoryboard.main?.instantiateController(withIdentifier: .replyWindowController) as! NSWindowController
let replyPopupViewController = windowController.contentViewController as! ReplyPopoverViewController
replyPopupViewController.comment = comment
let window = windowController.window!
window.setContentSize(popover.contentSize)
window.isMovableByWindowBackground = true
let visualEffectView = window.contentView as! NSVisualEffectView
visualEffectView.state = .active
visualEffectView.material = .popover
#!/usr/bin/env bash
set -euo pipefail
MDT="${1:-${MACOSX_DEPLOYMENT_TARGET:-$(sw_vers -productVersion | cut -d. -f1).0}}"
RUSTC="${RUSTC:-$(rustup which rustc)}"
ROOT="${ROOT:-$PWD/linkedit-repro-${MDT}}"
mkdir -p "$ROOT"
cd "$ROOT"
cat > pm.rs <<'RS'