Skip to content

Instantly share code, notes, and snippets.

View mattcan's full-sized avatar

Matthew Cantelon mattcan

View GitHub Profile
@Latz
Latz / testlisttable.php
Created March 21, 2012 14:27
Sample plugin for usage of WP_List_Table class (basic version)
<?php
/*
Plugin Name: Test List Table Example
*/
if( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
class My_Example_List_Table extends WP_List_Table {
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@emmgfx
emmgfx / gist:4540222
Created January 15, 2013 17:16
IE=edge
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@bitsandbooks
bitsandbooks / add-nginx-vhost.sh
Last active June 22, 2017 01:45
My custom script for adding a vhost to Nginx.
#!/usr/bin/env bash
#
# Nginx - new server block
# http://rosehosting.com
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
working() { echo -ne '\e[1;33m'$1'\e[m'; } # Yellow
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }
@smoothdeveloper
smoothdeveloper / gist:6898062
Created October 9, 2013 08:29
dynamic transact-sql contingency table implementing http://stackoverflow.com/a/10404455 in a generic manner
create procedure dbo.dynamic_simple_contingency_table_query
@withExpression nvarchar(max) -- ^ optional with CTE expression
, @selectStatement nvarchar(max) -- ^ select statement, should return at least three columns, whose name matches following parameters
, @row_column_key nvarchar(max) -- ^ column name which identifies row keys (result will have as many distinct rows as found here)
, @column_column_key nvarchar(max) -- ^ column name which identifies column keys (result will have as many distinct values as found here)
, @fact_column_key nvarchar(max) -- ^ column name which contains facts
as
begin
declare @sql nvarchar(max)
set @sql = @withExpression
#! /bin/bash
# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
echo "Please create this file and copy past your stream key into it. Open this script for more details."
@xiongjia
xiongjia / my_vim_plugin.py
Last active September 14, 2017 07:43
A simple Vim plugin with python #devsample #vim
#!/usr/bin/env python
import sys, os
# The test function for VIM plugin
def my_test(vim, vim_ver):
buf = vim.current.buffer
# append process id & python version info to the buffer
buf.append("VIM process %d; vim version: %s\n" % (os.getpid(), vim_ver))
buf.append("Py version: %s\n" % sys.version_info)
@wbtuomela
wbtuomela / go1.3.1-install-deb.sh
Last active August 29, 2015 14:05 — forked from demofly/go1.3-install-deb.sh
Debian Packages for golang-1.3.1
apt-get install devscripts build-essential
apt-get build-dep golang-go
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1-1.dsc
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1.orig.tar.gz
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1-1.debian.tar.xz
dpkg-source -x golang_1.3.1-1.dsc
cd golang-1.3.1/
debuild -us -uc
@staringispolite
staringispolite / asciiputsonglasses
Last active May 27, 2024 09:28
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■