Skip to content

Instantly share code, notes, and snippets.

View kolpanic's full-sized avatar

Karl Moskowski kolpanic

View GitHub Profile
@kolpanic
kolpanic / Launch1PasswordSearch.swift
Last active August 3, 2021 16:23
For use in a macOS app to launch 1Password and display all login items for a particular domain. Use onePasswordAvailable in Cocoa Bindings to enable or hide a UI element. Use onePasswordIcon as the image for the UI element.
// set the domain in the search URL appropriately for your site
private let onePasswordSearchURL = URL(string: "onepassword://search/EXAMPLE.COM", relativeTo: nil)!
// bind this to the NSButton's Hidden value, with a Value Transformer of NSNegateBoolean
@objc dynamic var onePasswordAvailable : Bool {
return (NSWorkspace.shared.urlForApplication(toOpen: onePasswordSearchURL) != nil)
}
// bind this to the NSButton's Image value
@kolpanic
kolpanic / update_hosts
Last active August 18, 2023 13:02
Block unwanted parasites by redirecting them to `0.0.0.0`
#!/bin/bash
# Downloads Steven Black's "Unified hosts + fakenews" hosts file
# and replaces the existing system hosts file
# https://github.com/StevenBlack/hosts
#
# If you want to make any manual persistent changes to the system hosts
# file, run this script first, then make sure that the change is backed up to
# /etc/hosts.orig

WWDC Tips

In addition to these, Quora also has huge list.

Registration

  • Since WWDC started selling out every year, Apple instituted a lottery system for tickets. You enter when it's announced, and, if you're lucky enough to get one, you'll be immediately billed for the ticket. If you'll be needing your boss's permission (approval for the expense and/or the week off work), get it early.
  • If you're a student, Apple usually offers a limited number of free passes through the Student Scholarship.

Travel

  • If you can get a cancellable flight and hotel reservations at reasonable prices as soon as the WWDC dates are announced, book them. Otherwise, wait until you win the ticket lottery.
  • If your passport is expiring within three months of departure, renew it now. You may have border trouble otherwise.