Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Homebrew

First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.

@alexpos
alexpos / gist:8684574
Created January 29, 2014 09:34 — forked from ype/gist:8684551
;;Add your default-elisp task id to "id-of-default-elisp-task"
(defvar p_e/default-elisp-id "id-of-default-elisp-task")
;;This lets you M-x to your elisp task
(defun p_e/clock-in-default-elisp ()
(interactive)
(org-with-point-at (org-id-find p_e/default-elisp-id 'marker)
(org-clock-in '(16))))
;;In the elisp task do something like this...
@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
@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
<?php
/*
Plugin Name: MyWidget
Description: Description
Author: Pixolin
*/
/********************
* add a new Widget to WP_Widget class
;;; 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
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.' );
}

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
// 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();