This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// alter metabox titles | |
add_filter('gettext', 'wps_translation_mangler', 10, 4); | |
function wps_translation_mangler($translation, $text, $domain) { | |
global $post; | |
if (!empty($post)) { | |
$translations = &get_translations_for_domain( $domain); | |
if($post->post_type == 'ufcf_person'){ | |
if ( $text == 'Set featured image') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
function build_url($args = array()){ | |
$defaults = array( | |
'scheme' => 'http', | |
'host' => '', | |
'path' => '', | |
'query' => '', | |
'user' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fp = fopen('wordpress.zip', 'w'); | |
$ch = curl_init('http://wordpress.org/latest.zip'); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_FILE, $fp); | |
curl_exec($ch); | |
curl_close($ch); | |
exec('unzip wordpress.zip'); | |
exec('cp -R wordpress/* .'); | |
exec('rm wordpress.zip'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_content', 'remove_empty_p', 20, 1 ); | |
function remove_empty_p( $content ){ | |
// clean up p tags around block elements | |
$content = preg_replace( array( | |
'#<p>\s*<(div|aside|section|article|header|footer)#', | |
'#</(div|aside|section|article|header|footer)>\s*</p>#', | |
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#', | |
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#', | |
'#<p>\s*</(div|aside|section|article|header|footer)#', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Gist oEmbed | |
Plugin URI: http://ninnypants.com | |
Description: Embed gists into posts | |
Version: 1.0 | |
Author: ninnypants | |
Author URI: http://ninnypants.com | |
License: GPL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool process_record_user( uint16_t keycode, keyrecord_t *record ) { | |
switch ( keycode ) { | |
case SLACK_ZOOM: | |
if ( record->event.pressed ) { | |
SEND_STRING( SS_DOWN( X_LGUI ) SS_TAP( X_SPACE ) SS_UP( X_LGUI ) ); | |
_delay_ms( 250 ); | |
SEND_STRING( SS_TAP( X_Z ) SS_TAP( X_O ) SS_TAP( X_O ) SS_TAP( X_M ) SS_TAP( X_ENTER ) ); | |
_delay_ms( 5000 ); | |
SEND_STRING( SS_DOWN( X_LGUI ) SS_TAP( X_SPACE ) SS_UP( X_LGUI ) ); | |
_delay_ms( 250 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M104 S0 ;extruder heater off | |
M140 S0 ;heated bed heater off (if you have it) | |
G91 ;relative positioning | |
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure | |
G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more | |
G28 X0 ;move X to endstop out of the way | |
G28 Y210; move bed out for easier access | |
M84 ;steppers off | |
G90 ;absolute positioning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Show Multisite IDs | |
Plugin URI: http://ninnypants.com | |
Description: Adds table column to show site ID | |
Version: 1.0 | |
Author: ninnypants | |
Author URI: http://ninnypants.com | |
License: GPL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Single_Page_Walker extends Walker_Nav_Menu{ | |
function start_el(&$output, $item, $depth, $args) { | |
global $wp_query; | |
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; | |
$class_names = $value = ''; | |
$classes = empty( $item->classes ) ? array() : (array) $item->classes; | |
$classes[] = 'menu-item-' . $item->ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.extend(jQuery.easing,{easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a}}); |
NewerOlder