Skip to content

Instantly share code, notes, and snippets.

View dansheffler's full-sized avatar

Dan Sheffler dansheffler

View GitHub Profile
@dansheffler
dansheffler / myInsertDate.py
Last active August 29, 2015 14:27
A quick Sublime Text plugin for inserting the date at the current cursor position
import sublime, sublime_plugin, time
class insertDateCommand(sublime_plugin.TextCommand):
def run(self, edit):
date = time.strftime("%Y-%m-%d")
self.view.insert(edit, self.view.sel()[0].begin(), date)
@dansheffler
dansheffler / Default (Windows).sublime-keymap
Created August 11, 2015 21:25
InsertDate key command
{ "keys": ["ctrl+k", "ctrl+d"], "command": "insert_date" },
@dansheffler
dansheffler / myJekyll.py
Last active August 29, 2015 14:27
Quick and dirty Sublime Text 3 plugin to create a new Jekyll post.
import sublime, sublime_plugin, time
class MyJekyllCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().show_input_panel("Name of New Post", "", self.create_post, None, None)
def create_post(self, theTitle):
date = time.strftime("%Y-%m-%d-")
safeTitle = date + theTitle.lower().replace(" ","-")
path = "/Users/dansheffler/Dropbox/dansheffler/_posts/" + safeTitle + ".md"
@dansheffler
dansheffler / zettel_link.tmLanguage
Last active May 7, 2021 21:31
A syntax definition for Sublime Text 3 that extends Academic Markdown to include my own wiki-style links
[
{ "keys": ["ctrl+super+f"], "command": "make_footnote"}
]
# Free Will Problem #
Under this heading I mean to separate off those issues of
[[Freedom]] that have to do with the *metaphysical* problem of free
will and determinism. As opposed to political or theological
freedom. This is also distinct from the problem of the compatibility
of free will and divine foreknowledge.
According to [[Peter van Inwagen]]'s proposal we should understand
the "problem of free will" as (I am glossing):
@dansheffler
dansheffler / MyWiki.py
Created May 7, 2015 10:54
MyWikiLinks
import sublime, sublime_plugin, os, re, subprocess
class FollowWikiLinkCommand(sublime_plugin.TextCommand):
def run(self, edit):
settings = sublime.load_settings('MyWiki.sublime-settings')
directory = settings.get('wiki_directory')
directory = os.path.expanduser(directory)
extension = settings.get('wiki_extension')
# Open BibDesk and clear any search or group selection
tell application "BibDesk"
do shell script "open -a bibdesk"
set libGroups to the library groups of the front document
set group selection of front document to libGroups
set filter field of front document to ""
end tell
# Bring the main BibDesk window to the front
set theTitle to "mybib.bib"
### McCabe - *Plato's Individuals* ###
### 2. Particulars ###
Extreme contrast between two different kinds of individuals or unities: forms, "one over many" and particulars "one under many."
[Page 25](sk://mccabe94#41)
Plato's distrust of the physical world may be ontological or it may be epistemological. Thesis: the latter because the physical world is not self-explanatory.
[Page 25](sk://mccabe94#41)
tell application "Skim"
set theFile to the file of the front document
set outText to ""
set newLine to ASCII character 10
# Get the relevant bibliographic information for the front PDF in Skim
tell application "BibDesk"
repeat with currentPub in publications of front document
if linked file of currentPub is {} then
set bibFile to 0