Skip to content

Instantly share code, notes, and snippets.

View sxalexander's full-sized avatar
🚌
Reticulating Splines

Sam Alexander sxalexander

🚌
Reticulating Splines
View GitHub Profile
https://gist.github.com/ce2eda8ad7ae450ee73a
<?php
/**
* Gets the current global post type if one is set
*/
function x_get_current_post_type() {
global $post, $typenow, $current_screen;
if( $post && $post->post_type )
$post_type = $post->post_type;
elseif( $typenow )
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@sxalexander
sxalexander / ssh-copy-id
Created September 1, 2011 23:39
Copy your local ssh key to a remote machine
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@sxalexander
sxalexander / .gitconfig
Created December 8, 2010 22:45
my gitconfig settings
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "branch"]
current = yellow reverse
@sxalexander
sxalexander / memusage.rb
Created November 3, 2010 00:13
WebFaction Memory Usage Script
#!/usr/bin/env ruby
# Memory usage script for WebFaction customers adapted to attempt to
# draw username from the pwd
# Nick Trew <[email protected]>
# 2009-05-25
# START CONFIG #
require 'pathname'