Skip to content

Instantly share code, notes, and snippets.

View bobrocke's full-sized avatar

Bob Rockefeller bobrocke

View GitHub Profile
@bobrocke
bobrocke / BBEdit: Open iTerm2 Here.applescript
Last active July 8, 2016 11:47
An AppleScript to open iTerm2 at the file system location of the selected file or folder in BBEdit.
tell application "BBEdit" to set theFile to file of document 1
tell application "Finder" to set theFolder to (container of file theFile) as alias
set theUnixPath to POSIX path of theFolder
tell application "iTerm"
activate
tell current window
close
end tell
tell (create window with profile "Default")
@bobrocke
bobrocke / item.html.twig
Created November 29, 2015 17:36
Blog post template
<!-- /templates/item.html.twig -->
{% embed 'partials/base.html.twig' %}
{% set base_url = base_url_relative ~ site.blog.route %}
{% block content %}
<div class="article-block">
{% include 'partials/blog_item.html.twig' with {'blog':page.parent, 'truncate':false} %}
</div>
@bobrocke
bobrocke / base.html.twig
Created November 29, 2015 17:35
Base Partial
<!-- /templates/partials/base.html.twig -->
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{{ site.title }}{% if header.title %} - {{ header.title }}{% endif %}</title>
{% include 'partials/metadata.html.twig' %}
@bobrocke
bobrocke / gist:7ae20b962ba77d93d985
Last active November 15, 2015 16:31
TextMate Markdown insertion
{ patterns = (
{ name = 'source.yaml.front-matter';
begin = '\A-{3}';
end = '-{3}';
patterns = ( { include = 'source.yaml'; } );
},
{ name = 'text.html.markdown.classes';
begin = '\{';
end = '\}';
},
{ patterns = (
{ name = 'source.yaml.front-matter';
begin = '\A-{3}';
end = '-{3}';
patterns = ( { include = 'source.yaml'; } );
},
{ name = 'text.html.markdown.classes';
begin = '\)\{';
end = '\}';
},
{ patterns = (
{ name = 'source.yaml.front-matter';
begin = '\A-{3}';
end = '-{3}';
patterns = ( { include = 'source.yaml'; } );
},
{ name = 'text.html.markdown.classes';
begin = '\)\{';
end = '\}';
},
@bobrocke
bobrocke / snippet
Created May 26, 2015 23:56
Atom Command Registration
activate: function(state) {
this.subscriptions = new CompositeDisposable();
this.subscriptions.add(atom.commands.add('.platform-darwin .tree-view', {
'open-a-terminal:openroot': (function(_this) {
return function() {
return _this.openroot();
};
})(this)
}));