Skip to content

Instantly share code, notes, and snippets.

import sys, json
class External(object):
def run(self):
line = sys.stdin.readline()
while line:
try:
response = self.process(json.loads(line.decode('utf_8')))
except Exception, e:
response = {'code':500, 'json':{'error':True, 'reason':"Internal error processing request (%s)" % e}}

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@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 / 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 / showFiles.fish
Created August 3, 2016 18:18
Mac finder showhidden files fish function
function showFiles
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder /System/Library/CoreServices/Finder.app $argv
end
@steve-ross
steve-ross / hideFiles.fish
Created August 3, 2016 18:19
fish function hide hidden files fish function
function hideFiles
defaults write com.apple.finder AppleShowAllFiles NO
killall Finder /System/Library/CoreServices/Finder.app $argv
end
@steve-ross
steve-ross / .direnvrc
Last active November 14, 2017 19:28
Some Useful direnv.net helpers
install_nvm(){
log_status "Installing NVM"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
nvm install
}
npm_install(){
local HAS_NODE_MODULES_BIN=$(find node_modules/.bin)
if [ -z "$HAS_NODE_MODULES_BIN" ]; then
@steve-ross
steve-ross / starship-iterm.toml
Last active September 7, 2021 16:47
Starship Config
# place in ~/.config/starship-iterm.toml
# Don't print a new line at the start of the prompt
add_newline = false
[directory]
style = ""
disabled = true
[character]
disabled = true
@steve-ross
steve-ross / patch-bigcommerce-checkout.js
Last active April 6, 2022 13:54
Script for patching/changing the BigCommerce Checkout page
var toPatch = [
{ sel: '[name="billingSameAsShipping"]' , click: true },
{ sel: '[name="redeemableCode"]' , prop: 'placeholder', val: 'Enter Promo Code' },
{ sel: '.ReactModalPortal [name="redeemableCode"]' , prop: 'placeholder', val: 'Enter Promo Code' },
];
var matchedSubscriptionItems = [];
function patchIt(patches) {
var afterElementExists = function(selector, cb) {
function findit() {
@steve-ross
steve-ross / starship.toml
Created September 7, 2021 16:46
My starship config
[aws]
disabled = true
[package]
display_private = true
[env_var]
variable = "NPM_PACKAGE_NAME"
symbol = "🎁"