Skip to content

Instantly share code, notes, and snippets.

View voostindie's full-sized avatar

Vincent Oostindië voostindie

  • The Netherlands
View GitHub Profile
@voostindie
voostindie / get-obsidian-file-link.rb
Last active October 12, 2022 19:58
Hook: alternative "Get Address" script for Obsidian that returns file links
@voostindie
voostindie / get-obsidian-address.rb
Last active March 13, 2022 07:28
Hook: alternative "Get Address" script for Obsidian
#!/Users/vincent/.rbenv/shims/ruby
#
# Generate an Obisidian link to the currently opened document, for
# use in Hook.
#
# The built-in Hook script uses the `obsidian://hook-get-address` URI
# handler that's built-in to Obsidian, and that sucks, because it messes
# up the clipboard and has all kinds of timing issues. It's slow.
# This script is better in many respects, IMHO.
#
#!/usr/bin/env ruby
#
# Downloads a new version of the MVPS hosts file and merges it into the local
# hosts file.
#
# Only lines starting with `0.0.0.0` are merged; all other lines are skipped.
#
# All entries from the MVPS hosts file are put between markers. If the markers
# are already present in the hosts file, everything between them is replaced
# with the contents of the MVPS hosts file.
@voostindie
voostindie / Rename file.tmCommand
Created August 22, 2014 16:04
TextMate 2 command to rename the current file in place, using a shortcut (Ctrl + Cmd + R)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui"
@voostindie
voostindie / GitHub Fenced Code Blocks.tmLanguage
Created August 22, 2014 16:02
TextMate 2 syntax highlighting for GitHub Fenced Code blocks in Markdown. Extends the standard Markdown bundle.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>md</string>
</array>
<key>injectionSelector</key>
<string>(L:text.html.markdown)</string>