Skip to content

Instantly share code, notes, and snippets.

@gunderwonder
gunderwonder / link-devonthink-bear-things.applescript
Created May 6, 2018 17:19
Creates a named DEVONthink group, a Bear note and Things project, linked together
@hawkfalcon
hawkfalcon / nssharingservice.swift
Created May 2, 2018 23:09
Custom NSSharingService & NSSharingServicePickerDelegate
extension ViewController: NSSharingServicePickerDelegate {
func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, sharingServicesForItems items: [Any], proposedSharingServices proposedServices: [NSSharingService]) -> [NSSharingService] {
guard let image = NSImage(named: NSImage.Name("copy")) else {
return proposedServices
}
var share = proposedServices
let customService = NSSharingService(title: "Copy Text", image: image, alternateImage: image, handler: {
if let text = items.first as? String {
self.setClipboard(text: text)
@hawkfalcon
hawkfalcon / sharesheet.swift
Last active March 31, 2019 07:05
Share Sheet NSSharingServicePicker
@IBAction func shareSheet(_ sender: NSButton) {
let text = "Text to share..."
let sharingPicker = NSSharingServicePicker(items: [text])
sharingPicker.delegate = self
sharingPicker.show(relativeTo: NSZeroRect, of: sender, preferredEdge: .minY)
}
@skyzh
skyzh / Bear.md
Created April 18, 2018 15:04
Prepare Bear App exported notes for printing

Texts are darkened and serif-ied for better printing visual effects.

Before

image

After

image

@unbug
unbug / disable_autospell.md
Last active July 12, 2024 21:06 — forked from urbanautomaton/disable_autospell.md
disable autospell completely
sudo mv /System/Library/Services/AppleSpell.service{,.disabled}

Nvm. For anyone else having this problem you need to reboot your mac and press ⌘+R when booting up. Then go into Utilities > Terminal and type the following commands:

csrutil disable
reboot 
@benizar
benizar / multiple-git-clone.md
Last active May 3, 2024 21:45
Ubuntu post-installation script for cloning multiple git repositories.

multiple-git-clone.sh

Every time I install Ubuntu on a different computer, I need to clone again the same git repositories. This is why I use this bash script.

Usage

It clones the list of repositories to a convenient working directory in the home folder. I use the /home/git folder.

Arguments are lists of git repositories. One repo per line, one file per list. See the example:

@15cm
15cm / compinit-oh-my-zsh.zsh
Last active November 1, 2021 15:01 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# compinit optimization for oh-my-zsh
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
@mikeatlas
mikeatlas / readme.md
Created March 21, 2018 22:10
maxfiles ulimit on macos
@itst
itst / INSTALL.md
Last active October 26, 2019 22:58
Installling ibooks-highlights on macOS 10.12

Installation

  1. Download/clone https://github.com/matttrent/ibooks-highlights
  2. pip3 install click
  3. brew install libyaml
  4. cd to cloned copy
  5. sudo python3 setup.py install
  6. copy templates from ibook_highlights/templates to /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ibooks_highlights-0.1.0-py3.6.egg
  7. Create directoy to hold your notes. mkdir ~/Documents/Annotations
  8. cd ~/Documents/Annotations
# Mac to stay awake indefinitely via the CLI
$ pmset noidle
# pmset's manual can be found @
# https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pmset.1.html