This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place this early in your application's startup process, such as an init | |
let cb: CFNotificationCallback = { (centre: CFNotificationCenter?, observer: UnsafeMutableRawPointer?, name: CFNotificationName?, object: UnsafeRawPointer?, userInfo: CFDictionary?) in | |
print("Notification: ", terminator: "") | |
if let name = name { | |
print("(\(name.rawValue)) ") | |
} else { | |
print() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir $HOME/.terminfo/ && \ | |
screen_terminfo="screen-256color" && \ | |
infocmp "$screen_terminfo" | sed \ | |
-e 's/^screen[^|]*|[^,]*,/screen-256color|screen with italics support,/' \ | |
-e 's/%?%p1%t;3%/%?%p1%t;7%/' \ | |
-e 's/smso=[^,]*,/smso=\\E[7m,/' \ | |
-e 's/rmso=[^,]*,/rmso=\\E[27m,/' \ | |
-e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/' > /tmp/screen.terminfo && \ | |
tic /tmp/screen.terminfo && \ | |
echo set -g default-terminal "screen-256color" | tee -a ~/.tmux.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@available(macOS 10.15, *) | |
extension NSEvent { | |
static func publisher(scope: Publisher.Scope, matching: EventTypeMask) -> Publisher { | |
return Publisher(scope: scope, matching: matching) | |
} | |
public struct Publisher: Combine.Publisher { | |
public enum Scope { | |
case local, global | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/* | |
Copyright 2013 Stuart Carnie and other contributors | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to |
OlderNewer