- Set cursor to the variable name.
- Press and hold "SHIFT" key until all occurrences of the variable are highlighted.
- CMD + CTRL + E and start edit in scope.
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
import Foundation | |
class Foo { | |
var bar: Int? = 1 | |
} | |
enum BarEnum: Int { |
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
// method 1 | |
extension NSAttributedString { | |
static func from(html: String) throws -> NSAttributedString { | |
guard let data = html.data(using: String.Encoding.unicode, allowLossyConversion: true) { | |
throws ArgumentError.invalidArgument("Invalid `html` string, failed to convert it to `Data`.") | |
} | |
return try NSAttributedString( | |
data: data, |
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
import Cocoa | |
class FooWC: NSWindowController { | |
} | |
extension FooWC: NSWindowDelegate { | |
func windowWillClose(_ notification: Notification) { | |
guard let win = notification.object as? NSWindow else { |
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
import sys | |
import os | |
import re | |
import json | |
def _parse_strings_file_path(): | |
if len(sys.argv) < 2: | |
return |
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
<?jelly escape-by-default='true'?> | |
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:g="glide"> | |
<html> | |
<head> | |
<title>${project.name}</title> | |
<style> | |
body table, td, th, p, h1, h2 { | |
margin: 0; | |
font: normal normal 100% Georgia, Serif; | |
background-color: #ffffff; |
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
<?jelly escape-by-default='true'?> | |
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"> | |
<html> | |
<head> | |
<title>${project.name}</title> | |
<style> | |
body table, td, th, p, h1, h2 { | |
margin:0; | |
font:normal normal | |
100% Georgia, Serif; |
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
import Cocoa | |
// see https://team.goodeggs.com/overriding-swift-protocol-extension-default-implementations-d005a4428bda | |
protocol ToString { | |
func toString() -> String | |
} | |
extension ToString { |
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
/// HTTP Status | |
"http_status_100" = "Continue"; | |
"http_status_101" = "Switching Protocols"; | |
"http_status_102" = "Processing"; | |
"http_status_200" = "OK"; | |
"http_status_201" = "Created"; | |
"http_status_202" = "Accepted"; | |
"http_status_203" = "Non-authoritative Information"; | |
"http_status_204" = "No Content"; | |
"http_status_205" = "Reset Content"; |
- Set cursor to the variable name.
- Press and hold "SHIFT" key until all occurrences of the variable are highlighted.
- CMD + CTRL + E and start edit in scope.
OlderNewer