This file contains hidden or 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
// | |
// StreamLogoMarchingAnts.swift | |
// CustomShapeOutlines | |
// | |
// Created by from getstream.io on 12.2.2022. | |
// | |
import SwiftUI | |
struct StreamLogoMarchingAnts: View { |
This file contains hidden or 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
#!/bin/sh | |
# make sure you have imagemagick installed: brew install imagemagick | |
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file | |
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons | |
x=my_icon.png | |
y=${x%.*} | |
# delete the export directory so we start clean |
This file contains hidden or 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
extension NSProgressIndicator { | |
func set(tintColor: NSColor) { | |
guard let adjustedTintColor = tintColor.usingColorSpace(.deviceRGB) else { | |
contentFilters = [] | |
return | |
} | |
let tintColorRedComponent = adjustedTintColor.redComponent |
This file contains hidden or 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 | |
import PlaygroundSupport | |
/// A thread-safe array. | |
public class SynchronizedArray<Element> { | |
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent) | |
private var array = [Element]() | |
public init() { } | |
This file contains hidden or 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 UIKit | |
protocol CommandExecuting { | |
func run(commandName: String, arguments: [String]) throws -> String | |
} | |
enum BashError: Error { | |
case commandNotFound(name: String) | |
} |
This file contains hidden or 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
override func mouseDown(theEvent: NSEvent) | |
{ | |
/* Hard-coding this behavior isn't great, and shouldn't be necessary. (It should | |
be up to OS X to define what a contextual-menu click is/isn't, and we should | |
only care about vending our NSMenu via `menuForEvent:`). */ | |
let modifierFlags = theEvent.modifierFlags; | |
if (modifierFlags.contains(.ControlKeyMask)) | |
{ |
This file contains hidden or 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
// FAILURE | |
var array = [["name": "glen"]] | |
for item in array { | |
item["rank"] = "advanced" // Generates an @lvalue error | |
} | |
// Even though array is immutable, it's of type <Array<Dictionary<String,String>>, | |
// item is assigned by let automatically. | |
This file contains hidden or 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
# -------------------------------- | |
# macOS temporary files | |
# -------------------------------- | |
.DS_Store | |
*.lock | |
*.swp | |
# -------------------------------- | |
# Xcode | |
# -------------------------------- |
This file contains hidden or 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
NSButton *closeButton = [self standardWindowButton:NSWindowCloseButton]; | |
NSView *themeFrame = [closeButton superview]; | |
CGFloat buttonYOrigin = NSMaxY(themeFrame.frame)-34; | |
//Alter the button frames | |
NSRect closeFrame = closeButton.frame; | |
closeFrame.origin.y = buttonYOrigin; | |
closeButton.frame = closeFrame; |