Skip to content

Instantly share code, notes, and snippets.

View bgallagh3r's full-sized avatar

Brian Gallagher bgallagh3r

View GitHub Profile
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
@bgallagh3r
bgallagh3r / disable-plugins-when-doing-local-dev.php
Created May 31, 2012 14:32 — forked from LogixRepo/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@bgallagh3r
bgallagh3r / gist:3151989
Created July 20, 2012 17:19 — forked from panicsteve/gist:1641705
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@bgallagh3r
bgallagh3r / add_slug_to_body_class.php
Created May 31, 2012 14:35 — forked from keirwhitaker/add_slug_to_body_class.php
WordPress Page Template Snag Lists
<?php
// Add the filter and function to your functions.php file
add_filter('body_class', 'add_slug_to_body_class');
function add_slug_to_body_class($classes) {
global $post;
if(is_page()) {
$classes[] = sanitize_html_class($post->post_name);
} elseif(is_singular()) {
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@bgallagh3r
bgallagh3r / profile.ps1
Created August 30, 2012 18:05 — forked from markembling/profile.ps1
My preferred prompt for Powershell - includes git info.
# My preferred prompt for Powershell.
# Displays git branch and stats when inside a git repository.
# See http://gist.github.com/180853 for gitutils.ps1.
. (Resolve-Path ~/Documents/WindowsPowershell/gitutils.ps1)
function prompt {
$path = ""
$pathbits = ([string]$pwd).split("\", [System.StringSplitOptions]::RemoveEmptyEntries)
if($pathbits.length -eq 1) {
@bgallagh3r
bgallagh3r / template
Last active April 8, 2018 01:51 — forked from gistwebdev/template
Updated to work with Apache 2.4 (swap order/allow for Required all granted)
<VirtualHost *:80>
ServerAdmin template.email
ServerName template.url
DocumentRoot template.webroot
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@bgallagh3r
bgallagh3r / vhost
Last active April 8, 2018 01:51 — forked from gistwebdev/vhost
Fix for Apache 2.4 (required adding .conf extensions)
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
@bgallagh3r
bgallagh3r / album-lightbox.php
Created March 2, 2014 17:18
All NextGen Galleries in Lightbox - Loads all galleries on a single page via lightbox instead of going to the actual gallery page. Just add the files appropriately then use this shortcode `[album id=0 template=lightbox]` id of 0 will force NGG to load all galleries. What I did instead however was set the default compact album to use the lightbox…
<?php
// /wp-content/themes/YOURTHEME/nggallery/album-lightbox.php
// To set this theme, go into Gallery > Gallery Settings and change the template to album-lightbox.
/**
Template Page for the album overview
Follow variables are useable :
$album : Contain information about the album
@bgallagh3r
bgallagh3r / mirc.ini
Last active April 8, 2018 01:51 — forked from liamja/mirc.ini
[colors]
n5=Monokai,0,4,4,4,2,3,4,3,6,6,3,1,2,2,5,1,5,4,2,4,0,0,1,0,1,14,5,0,0,1
[palettes]
n5=2238503,15923448,15718758,3072678,7481081,12767183,2070525,26832,1632504,57344,94740,16776960,16515072,16711935,8355711,13816530