Skip to content

Instantly share code, notes, and snippets.

@eddiemoya
eddiemoya / git-smarter-example-git-log-path.sh
Last active August 29, 2015 13:57
Example of using "git log" with a specified file -- for oembed use on http://eddiemoya.com
# Show specifically only the last commit to affect the path/to/file -
# this will be the commit where the file as deleted.
git log -1 -- path/to/file
<?php
/*
* A walker class to use that extends wp_dropdown_categories and allows it to use the term's slug as a value rather than ID.
*
* See http://core.trac.wordpress.org/ticket/13258
*
* Usage, as normal:
* wp_dropdown_categories($args);
*
@eddiemoya
eddiemoya / git-jira.sh
Last active August 29, 2015 14:01
Uses JIRA API to create releases, squash merge branches with JIRA ID, title, and priority in the commit message.
#!/bin/sh
## Installation ##
# > git clone https://gist.github.com/1367d0aae9e059a57ebf.git ~/git-jira.sh
# > git config --global alias.jira '!. ~/git-jira.sh'
##
## Commands ##
#
@eddiemoya
eddiemoya / gist:24ea52b5487c11a0c7d9
Last active August 29, 2015 14:02
Open PDP JIRAs from the command line..
# To use this, open ~/.bash_profile, and add the function below.
# Then run . ~/.bash_profile to reload your profile.
# Usage: pdp <jira_number>
pdp() { open -a "Google Chrome" https://obujira.searshc.com/jira/browse/PDP-$1; }
@eddiemoya
eddiemoya / ucr-ingress.com-mobile.css
Last active August 29, 2015 14:17
Fix mobile layout bug on ucr-ingress.com
/* All Smartphones in portrait and landscape ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
#join_ucr {
text-align: center;
position : fixed;
font-size: 0px;
font-weight: bold;
padding-top: 0;
@eddiemoya
eddiemoya / gist:367031a5f3ba14385164
Created August 4, 2015 16:19
Weird config layout
conf/app1/nginx.conf
conf/app1/included-file.conf
conf/app1/other-included-file.conf
conf/app2/nginx.conf
conf/app2/included-file.conf
conf/app2/other-included-file.conf
conf/app3/nginx.conf
conf/app3/included-file.conf
@eddiemoya
eddiemoya / gist:2562465
Last active October 4, 2015 02:28
Basic Widgetized Areas
<?php ## functions.php
/**
* This 'registers' the sidebar and tells WordPress it exists, as well as names it
* and gives it wrapping markup for each widget, and the title if applicable.
*
* Change the markup to meet your needs.
*/
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Hero',
@eddiemoya
eddiemoya / print_pre.php
Last active October 5, 2015 15:47
Print Pre
<?php
function print_pre($array){
echo "<pre style='z-index:1000;background-color:rgba(192,192,192,0.9);left:0;top:100px;width:4000px;overflow:scroll;position:absolute;white-space: pre;'>";
print_r($array);
echo "</pre>";
}
@eddiemoya
eddiemoya / category-template-hierarchy-descendants.php
Created June 26, 2012 00:56
Category Template Hierarchy 'descendant-of-category' templates, allow any descendant to inherit the template of a set of parent categories.
add_filter('cth_category_template', 'descendant_templates');
/**
* My plugin will call your function, and pass it the list of all templates
* before sending them off to find which ones match.
*/
function descendant_templates($templates){
if(is_category()){
@eddiemoya
eddiemoya / MFI_more_mime_types.php
Created July 2, 2012 20:31
Allow non-image mime-types in the multiple featured image plugin
// In function kd_meta_box_output() replace
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ) );
//With...
$type = get_post_mime_type($iamge_id);
$icon = in_array($type, array('application/pdf')) ? true : false;
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ), $icon );