git cherry [-v] [<upstream> [<head> [<limit>]]]
git-cherry - Find commits yet to be applied to upstream
| #!/usr/bin/env ruby | |
| #encoding: utf-8 | |
| require 'json' | |
| old_keymap = JSON.parse IO.read('keymap-file') | |
| result = "Key|Description\n---|---\n" | |
| old_keymap.each do |keymap| | |
| keys = keymap['keys'] |
| Application('System Events') | |
| .processes['SystemUIServer'] | |
| .menuBars | |
| .menuBarItems | |
| .whose({ | |
| name: 'Notification Center' | |
| }) | |
| .menuBarItems() | |
| .reduce(function(a, b) { | |
| return a.concat(b); |
| CHARS = [*'A'..'Z', *'a'..'z'] | |
| def index_to_shortcut(number, base = 52) | |
| quotient, remainder = number.divmod(base) | |
| if quotient.zero? | |
| CHARS[remainder] | |
| else | |
| index_to_shortcut(quotient - 1, base) + CHARS[remainder] | |
| end |
| #!/bin/sh | |
| while getopts "c" opt | |
| do | |
| case $opt in | |
| c) | |
| do_cherry_pick=true | |
| ;; | |
| esac | |
| done |
git cherry [-v] [<upstream> [<head> [<limit>]]]
git-cherry - Find commits yet to be applied to upstream
| /* | |
| * Simple Clipboard Viewer in macOS | |
| * Run with Script Editor | |
| */ | |
| ObjC.import('AppKit') | |
| function getPasteboardItemsAsString () { | |
| const items = $.NSPasteboard.generalPasteboard.pasteboardItems |
| function search (text, keyword) { | |
| let start = 0 | |
| text = text.toLowerCase() | |
| keyword = keyword.toLowerCase() | |
| for (let i = 0; i < keyword.length; ++i) { | |
| const char = keyword[i] | |
| const index = text.indexOf(char, start) |
| ObjC.import('Cocoa') | |
| const windows = ObjC.deepUnwrap($.CGWindowListCopyWindowInfo($.kCGWindowListOptionOnScreenOnly | $.kCGWindowListExcludeDesktopElements, $.kCGNullWindowID)) | |
| Array.from(new Set(windows.map(w => w.kCGWindowOwnerName))) |