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
# Open Safari | |
tell application "Safari" | |
# Default to HackerNews | |
open location "https://news.ycombinator.com" | |
activate | |
end tell | |
# Open Outlook if you have it. | |
try | |
tell application "Microsoft Outlook" |
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 | |
find_latest_ruby_version() { | |
help_find_latest_version "rbenv" | |
} | |
find_latest_python_version() { | |
help_find_latest_version "pyenv" | |
} |
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
scripts: [~/.mitmproxy/scripts/toggle_macos_proxies.py, ~/.mitmproxy/scripts/error_response.py] | |
view_filter: "~dst amazon.com|google.com" | |
console_mouse: false | |
console_palette: dark | |
console_eventlog_verbosity: error |
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 | |
class Dynamic<T> { | |
var bind :(T) -> () = { _ in } | |
var value :T? { | |
didSet { | |
bind(value!) | |
} |
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
ffmpeg -i video.mp4 -i sub.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng out.mp4 |
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
final class TabBarController: UITabBarController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Copy the reference `self` into a variable. | |
var selfCopy = self | |
// Implicitly cast `selfCopy` to a UnsafeMutableRawPointer. | |
let ptr = UnsafeMutableRawPointer(&selfCopy) | |
// Set it free! |
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
US-AL | |
US-AK | |
US-AZ | |
US-AR | |
US-CA | |
US-CO | |
US-CT | |
US-DE | |
US-FL | |
US-GA |
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 | |
@IBDesignable | |
final class TimeRemainingIndicatorView: UIView { | |
@IBInspectable var percentageRemainingFillColor: UIColor = .green | |
@IBInspectable var percentageElapsedFillColor: UIColor = .white | |
@IBInspectable var borderWidth: CGFloat = 1 | |
@IBInspectable var borderColor: UIColor = .black | |
@IBInspectable var value: Double = 0 { |