Skip to content

Instantly share code, notes, and snippets.

View jonschlinkert's full-sized avatar
🤔
Trying to stay in the right branch of the wave function.

Jon Schlinkert jonschlinkert

🤔
Trying to stay in the right branch of the wave function.
View GitHub Profile
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active July 11, 2024 21:42
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
this is nothing
{
"jurisdiction": {
"england-wales": "England/Wales",
"wales": "Wales ",
"scotland": "Scotland",
"northern-ireland": "Northern Ireland",
"european-union": "European Union",
"united-kingdom": "United Kingdom",
"england": "England",
"noneu": "Foreign (Non E.U.)"

Idiomatic markdown docs

Initially this will be a collection of random tips. My goal is to start recording the things I've learned from maintaining 990+ projects on GitHub and NPM.

Overview

Sections

  • Optional TOC
  • Brief description
@jonschlinkert
jonschlinkert / markdown-toc_repeated-headings.md
Created December 15, 2015 19:42
Example table of contents generated by markdown-toc, correctly links repeated headings.
var cache = {};
function toRegex(str) {
return cache[str] || (cache[str] = new RegExp(str));
}
@jonschlinkert
jonschlinkert / include-helper.js
Created November 5, 2015 16:55
This handlebars helper is for grunt-assemble 0.4.x. Newer versions of assemble make this easier and probably not needed at all.
var extend = require('extend-shallow');
var fs = require('fs');
module.exports.register = function (handlebars, options) {
// you should be able to set `cwd` on assemble options in
// your grunt config
var opts = extend({cwd: ''}, options);
handlebars.registerHelper('include', function (filename) {
// to see what's on the context, do the following:
function App() {
this.views = {};
this.plugins = [];
}
App.prototype.use = function (fn) {
var plugin = fn(this);
if (typeof plugin === 'function') {
this.plugins.push(plugin.bind(this));
}