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 / contact_method.php
Created December 23, 2013 07:04
WP: Add fields to user profile
<?php
function modify_contact_methods($profile_fields) {
// Add new fields
$profile_fields['twitter'] = 'Twitter Username';
$profile_fields['facebook'] = 'Facebook URL';
$profile_fields['gplus'] = 'Google+ URL';
// Remove old fields
unset($profile_fields['aim']);
@alexpos
alexpos / wp-xml.py
Created June 8, 2013 08:18
Py: wordpress xml test
import markdown
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost
from wordpress_xmlrpc.methods import taxonomies
import gntp.notifier
import os
import sys
#Connection details for the WordPress xmlrpc connection
wpUrl = 'http://http://192.168.50.100:8051/xmlrpc.php'
wpUser = 'admin'
@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 / gist:5684673
Created May 31, 2013 12:28
WP: Add contact info to user profile - remove
function modify_contact_methods($profile_fields) {
// Add new fields
$profile_fields['twitter'] = 'Twitter Username';
$profile_fields['facebook'] = 'Facebook URL';
$profile_fields['gplus'] = 'Google+ URL';
// Remove old fields
unset($profile_fields['aim']);
class PHPDebug {
function __construct() {
if (!defined("LOG")) define("LOG",1);
if (!defined("INFO")) define("INFO",2);
if (!defined("WARN")) define("WARN",3);
if (!defined("ERROR")) define("ERROR",4);
define("NL","\r\n");
echo '<script type="text/javascript">'.NL;
@alexpos
alexpos / themedebug
Created May 31, 2013 07:56
template in js console
function themedebug() {
global $template; $var=basename($template);
?>
<script type="text/javascript">
console.log(<?php echo "\"debug: ".$var."\""; ?>);
</script>
<?php
}
add_action( 'wp_footer', 'themedebug' );