Skip to content

Instantly share code, notes, and snippets.

View og-shawn-crigger's full-sized avatar

Shawn Crigger og-shawn-crigger

View GitHub Profile
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@og-shawn-crigger
og-shawn-crigger / MAMP-DOCK-INVISIBLE.sh
Last active December 10, 2015 20:18 — forked from josue/MAMP-DOCK-INVISIBLE.sh
Hide MAMP Dock Icons Shell Scripts
#!/bin/bash
# Place this script in dir: /usr/bin
# Change permissions: sudo chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
#
# Ensure the MAMP 'Info.plist' file has the following entry:
# <key>LSUIElement</key>
# <string dock-visible="1">NO</string>
#
# Usage:
@og-shawn-crigger
og-shawn-crigger / memorykiller.sh
Created October 18, 2012 00:34
V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.
#!/system/bin/sh
# Copyright© 2011 Juwe11
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,6144,12288,14336,18432" > /sys/module/lowmemorykiller/parameters/minfree
fi
if [ -e /proc/sys/vm/swappiness ]; then
echo "50" > /proc/sys/vm/swappiness
fi
@og-shawn-crigger
og-shawn-crigger / .bash_aliases.sh
Created October 11, 2012 01:26
Couple Apache Bash Aliases
# Apache 2 Aliases - Reboot and Log helper
alias a2reboot='sudo apachectl restart && sudo httpd -S'
alias a2log='sudo cat /var/log/apache2/error_log';
@og-shawn-crigger
og-shawn-crigger / jquery.data.js
Created October 9, 2012 21:00
jQuery extension to grab all data from a element
/**
This is stolen from jQueryUI 1.9 but works well by itself, it will add a Pseudo selector to select all data from a element
usage is
var data = $(".selector:data()");
console.log(data);
*/
$.extend( $.expr[ ":" ], {
@og-shawn-crigger
og-shawn-crigger / chosen-extras.js
Created October 5, 2012 14:55
Chosen Select Box Value/Text getter
// ------------------------------------------------------------------------
// SET NAMESPACE TO AVOID CONFLICTS AND HOLD CONFIG VALUES
// ------------------------------------------------------------------------
var App = App || {};
// Basic Config and Language Options
App = {
@og-shawn-crigger
og-shawn-crigger / jquery.arrayCompare.js
Created October 4, 2012 18:42
jQuery Array Compare
/**
* Compare two arrays if the are equal even if the have different order.
*
* @link http://stackoverflow.com/a/7726509
*/
jQuery.extend({
/**
* @param {array} a
* First array to compare.
* @param {array} b
@og-shawn-crigger
og-shawn-crigger / clearform.js
Created October 4, 2012 18:42
Clear form in jQuery
/**
* Compare two arrays if the are equal even if the have different order.
*
* @link http://stackoverflow.com/a/7726509
*/
jQuery.extend({
/**
* @param {array} a
* First array to compare.
* @param {array} b
@og-shawn-crigger
og-shawn-crigger / Autoloader.php
Created September 28, 2012 23:56
Lex Parser for Bonfire
<?php
/**
* The Lex Autoloader (this is case-sensative)
*/
class Lex_Autoloader
{
protected static $load_path = './';
@og-shawn-crigger
og-shawn-crigger / ga.j
Created September 26, 2012 04:03
google anyalitcs track outgoing links
$(document).ready(function(){
var localserver = "blog.shawnc.org";
if(window.pageTracker)
{
$("a").not(".external").not("a[href^='http://"+localserver+"']").click(function(){
$(this).attr("target", "blank");
var url = $(this).attr("href").replace(/^http\:\/\/(www\.)*/i, "");
pageTracker._trackPageview('/external/'+url);