Skip to content

Instantly share code, notes, and snippets.

@alexpos
alexpos / gist:2837152
Created May 30, 2012 15:52
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@alexpos
alexpos / gist:3907495
Created October 17, 2012 19:13 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

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
@alexpos
alexpos / brettquix.txt
Created October 22, 2012 13:47 — forked from ttscoff/brettquix.txt
Brett's Quix File
@Brett's searches
@Brett's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo)
grep https://www.cueup.com/?q=%s&fq=1 Greplin
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo)
bt https://duckduckgo.com/site:brettterpstra.com%20%s BrettTerpstra.com (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software)
// Open up the media manager to handle editing image metadata.
$('#soliloquy-area').on('click.soliloquyModify', '.modify-image', function(e) {
e.preventDefault();
var soliloquy_frames = {}; // Store our workflows in an object
var frame_id = $(this).next().attr('id').split('-')[3]; // Unique ID for each workflow
var default_view = wp.media.view.AttachmentsBrowser; // Store the default view to restore it later
// If the media frame already exists, reopen it.
if ( soliloquy_frames[frame_id] ) {
soliloquy_frames[frame_id].open();

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
<?php
add_filter( 'preprocess_comment', 'minimal_comment_length' );
function minimal_comment_length( $commentdata ) {
$minimalCommentLength = 20;
if ( strlen( trim( $commentdata['comment_content'] ) ) < $minimalCommentLength )
{
wp_die( 'All comments must be at least ' . $minimalCommentLength . ' characters long.' );
}
;;; pbcopy.el --- Emacs Interface to pbcopy
;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu
;; This file 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 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
<?php
/*
Plugin Name: MyWidget
Description: Description
Author: Pixolin
*/
/********************
* add a new Widget to WP_Widget class
@alexpos
alexpos / wp-console-debug.php
Created May 31, 2013 14:01 — forked from Rayken/wp-console-debug.php
WP: console debug
<?php
/*
Plugin Name: JavaScript Console Debug
Description: Debug your PHP in the console.
Version: 1.0
Author: DRSK
*/
/**
// Standard debugging
@alexpos
alexpos / 0_reuse_code.js
Created December 23, 2013 07:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console