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: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);
@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: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 / 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: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: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:1904153
Last active October 1, 2015 02:38
Alternate OpenVBX nginx server config. Slightly different than the sample included with OpenVBX right now and working on my nginx 0.8.54 + PHP 5.3.5 install
server {
listen 80;
server_name openvbx.tld;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
location /(favicon.ico|robots.txt) {
access_log off;
log_not_found off;
error_page 404 /404;
@Gipetto
Gipetto / gist:1925295
Created February 27, 2012 16:45
Proxy configuration for OpenVBX & Twilio-PHP api library
<?php
// template for setting CURL proxy options for OpenVBX
// add the configuration lines below to the file
// `OpenVBX/libraries/OpenVBX.php` on line 375 with the
// config below and then enter the values for your Proxy
// proxy type
$_proxy_type = 'HTTP'; // proxy type
// The address of your proxy server
@Gipetto
Gipetto / gist:2989520
Created June 25, 2012 16:13
Allow shortcodes to be validated as proper numbers in OpenVBX. This is theoretical and untested.
<?php
/**
* Allow Shortcodes to be validated as normal phone numbers in OpenVBX
*
* Open the file `OpenVBX/libraries/PhoneNumber.php` and replace the function
* `PhoneNumbers::normalizePhoneNumbertoE164` with the function definition below.
* Then replace the `$shortcodes` array members with a list of numbers to
* be considered valid shortcodes.
*/
@Gipetto
Gipetto / gist:4704578
Last active December 12, 2015 03:08
"Fix" postfix on OS X 10.8
#! /bin/bash
if [[ $EUID -ne 0 ]]; then
echo 'This script must be run as root'
exit 1
fi
launchctl unload -w /System/Library/LaunchDaemons/org.postfix.master.plist
mkdir -p /Library/Server/Mail/Data/spool/maildrop
/usr/sbin/postfix set-permissions