Skip to content

Instantly share code, notes, and snippets.

View andredsp's full-sized avatar

André Souza andredsp

View GitHub Profile
@andredsp
andredsp / iTermManPagerHandler.md
Last active February 17, 2022 14:55 — forked from jspiewak/iTermManPagerHandler
Configure iTerm2 to handle x-man-page URLs
  • Create a new profile, e.g. Man Page Viewer
  • Set the command to /bin/zsh -c "echo '$$HOST$$''$$PATH$$' | sed 's/\\// /g' | xargs man"
  • Select x-man-page from the "Schemes handled" drop down
@andredsp
andredsp / close_notifications.applescript
Created March 13, 2020 13:57
Close All Notifications (macOS)
to closeIncorrectEjections()
set totalClosed to 0
tell application "System Events"
tell process "NotificationCenter"
set closedWindows to 1 -- force first repeat loop
repeat until closedWindows = 0
set closedWindows to 0
set numwins to (count windows)
@andredsp
andredsp / Injectable.swift
Last active August 31, 2017 03:30
Simple protocol to inject dependencies when `init(with:)` is not available (e.g. XIB and Storyboard UIViewControllers)
//
// Injectable.swift
//
// Created by André Pinto on 06/05/17.
// Copyright © 2017 André Pinto. All rights reserved.
//
protocol Injectable {
/// Type which defines the dependencies to be injected