Skip to content

Instantly share code, notes, and snippets.

View bgallagh3r's full-sized avatar

Brian Gallagher bgallagh3r

View GitHub Profile
@bgallagh3r
bgallagh3r / gitutils.ps1
Created September 5, 2012 14:22 — forked from markembling/gitutils.ps1
Powershell functions for git information
# Git functions
# Mark Embling (http://www.markembling.info/)
# Is the current directory a git repository/working copy?
function isCurrentDirectoryGitRepository {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
@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) {
# 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 / 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
// 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 / 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()) {
@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/
*/