Skip to content

Instantly share code, notes, and snippets.

View Gipetto's full-sized avatar
💩
Doing the day-to-day.

Shawn Parker Gipetto

💩
Doing the day-to-day.
View GitHub Profile
@Gipetto
Gipetto / gist:1894045
Created February 23, 2012 17:59
Convert all category select checkboxes in to radio buttons in the WordPress post-edit screen.
// Convert all Category input checkboxes in to radio selects
// It completely replaces the elements with new ones and transfers
// the attributes from the old element to the new.
// We can't just change the type because of, you guessed it, Internet Explorer
// Yes, sometimes a hand grenade is easier than a scalpel ;)
jQuery('form#post').find('.categorychecklist input').each(function() {
var new_input = jQuery('<input type="radio" />'),
attrLen = this.attributes.length;
for (i = 0; i < attrLen; i++) {
@Gipetto
Gipetto / gist:1872357
Created February 20, 2012 23:47
Enable Carrington Theme Framework to contextually load page content templates by page name
<?php
/**
* Allow content templates to be loaded by page name
*
* ie: a page named "home" can load a special content template by adding a file
* to the content templates folder: `content/page-home.php`
*
* @param string $filename
* @param string $type
@Gipetto
Gipetto / gist:1733948
Created February 4, 2012 00:12
Simple OpenVBX Upgrade Script
#! /bin/bash
#
# A script that will upgrade the version of OpenVBX that resides in the /OpenVBX
# directory, back-up the database, copy the current version for backup and replace
# it with the develop branch. The old version is not deleted.
#
# Used for testing, not approved for production!
# Does not take 3rd party plugins in to account.
# customize this for your install
@Gipetto
Gipetto / gist:1447888
Created December 8, 2011 18:12
Inserting custom numbers in to the CallerId list (hack)
<?php // do not copy this line
// Add this code to `OpenVBX/controllers/iframe.php`
// In the 1.0.x branch insert the following on line 53
// In the 1.1.x branch insert the following on line 66
// Create a list of extra caller id numbers to add
// These numbers need to be validated in Twilio
// Validated numbers are listed in your Twilio Account: https://www.twilio.com/user/account/phone-numbers/verified
$custom_numbers = array(
@Gipetto
Gipetto / detect-displays.scpt
Created November 21, 2011 22:34
Detect Displays Applescript Trigger
# This is an Applescript to trigger the Detect Displays functionality quickly on OS X
# 1. save this to a file with a `.scpt` extension
# 2. make sure that the Displays menu is set to display in the OS X menu bar
# 3. use your favorite quick access app (Spotlight, LaunchBar, Quicksilver, etc...) to call the script
#
# See: http://top-frog.com/2010/05/29/automatically-download-chromium-nightly-builds/ for a
# caveat if you have trouble and are using AppleScript when you have Adobe applications installed
to click_menu_extra at menu_list
tell application "System Events" to tell process "SystemUIServer"'s menu bar 1
@Gipetto
Gipetto / gist:1295925
Created October 18, 2011 16:53
bxSlider IE8 Fade (actually jQuery.animate) fix
--- jquery.bxSlider.js
+++ (clipboard)
@@ -670,10 +670,10 @@
top: 0,
left: 0,
zIndex: 98
- });
+ });
$outerWrapper = $parent.parent().parent();
- $children.not(':eq('+currentSlide+')').fadeTo(0, 0);