Skip to content

Instantly share code, notes, and snippets.

@steve-ross
steve-ross / hub-browse-issue.fish
Last active March 9, 2017 18:12
Fish plugin to open the issue number for your git branch on github (if your branch is named) my-feature-branch#123 where #123 is your ticket number
function _git_branch_issue_number
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's/.*#//')
end
function hub-browse-issue
set -l issue_number (_git_branch_issue_number)
hub browse -- issues/$issue_number
end
@steve-ross
steve-ross / n98-magerun.phar.fish
Last active May 17, 2016 17:50
n98-magerun completions for fish
# Installation:
# This assumes that "n98-magerun.phar" is in your path!
# Copy to ~/.config/fish/completions/n98-magerun.phar.fish
# open new or restart existing shell session
for cmd in (n98-magerun.phar --raw --no-ansi list | sed "s/[[:space:]].*//g");
complete -f -c n98-magerun.phar -a $cmd;
end
@steve-ross
steve-ross / gist:3899678ad3491f3d570f7a4475bfbd39
Created April 22, 2016 19:51
Meteor Rebuild time on 2011 MacBook Pro 16GB RAM
=> Started your app.
=> App running at: http://localhost:3000
| (#3) Profiling: ProjectContext prepareProjectForBuild
|
| ProjectContext prepareProjectForBuild...........................527 ms (1)
| ├─ _initializeCatalog............................................46 ms (1)
| │ ├─ files.readFile 6 ms (16)
| │ ├─ files.exists 4 ms (9)
| │ ├─ runJavaScript package.js 3 ms (9)
# Aliases
alias m "meteor"
alias a "atom"
alias a. "atom ."
alias gst "git status"
alias gco "git checkout"
alias j "jump"
alias ef "atom ~/.config/fish/config.fish"
alias reload "source ~/.config/fish/config.fish"
alias ksd "sudo launchctl kickstart system/homebrew.mxcl.dnsmasq"
@steve-ross
steve-ross / n98-magerun.phar.fish
Created April 18, 2016 15:11
n98 magerun completions for fish
# Installation:
# This assumes that "n98-magerun.phar" is in your path!
# Copy to ~/.config/fish/completions/n98-magerun.phar.fish
# open new or restart existing shell session
for cmd in (n98-magerun.phar --raw --no-ansi list | sed "s/[[:space:]].*//g");
complete -f -c n98-magerun.phar -a $cmd;
end
@steve-ross
steve-ross / git-issue.fish
Created February 25, 2016 16:18
if you name your github branches ending in #123 this will open the issue on github (using hub)
function _git_branch_issue_number
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's/.*#//')
end
function git-issue
set -l issue_number (_git_branch_issue_number)
git browse -- issues/$issue_number
end
@steve-ross
steve-ross / select.js
Created November 25, 2015 17:05
autorun
Template.afSelect_semanticUI.onRendered(function() {
let node = this.$(this.firstNode);
node.dropdown(_.extend({
fullTextSearch : this.data.atts.fullTextSearch || false,
allowAdditions : this.data.atts.allowAdditions || false,
maxSelections : this.data.atts.maxSelections || false,
allowCategorySelection: this.data.atts.allowCategorySelection || false,
useLabels : this.data.atts.useLabels === false ? false : true
}, this.data.atts.settings));

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h

@steve-ross
steve-ross / turpentine_esi.xml
Created October 6, 2014 19:22
turpentine_esi for Magento 1.9 Demo Store
<?xml version="1.0"?>
<!--
Nexcess.net Turpentine Extension for Magento
Copyright (C) 2012 Nexcess.net L.L.C.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@steve-ross
steve-ross / test-queue.js
Last active August 29, 2015 14:06
ticker with queue
var fs = require('fs');
var async = require('async');
function updateJson(ticker, value, cb) {
async.waterfall([
function(next){
fs.readFile('stocktest.json', next);
},