Skip to content

Instantly share code, notes, and snippets.

View jimmitchell's full-sized avatar

Jim Mitchell jimmitchell

View GitHub Profile
@jimmitchell
jimmitchell / Disable Default Dashboard Widgets.php
Last active August 29, 2015 13:56
Disable Default WordPress Dashboard Widgets
/*
Disable Default Dashboard Widgets
@ http://digwp.com/2014/02/disable-default-dashboard-widgets/
*/
function disable_default_dashboard_widgets() {
global $wp_meta_boxes;
// wp..
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
@jimmitchell
jimmitchell / Finder_Add_Empty_Files.scpt
Last active August 29, 2015 14:12
AppleScript to Add Empty Files in Finder Quickly
property defaultFileName : "newFile.txt"
tell me to activate
set theFileName to text returned of (display dialog "Enter a file name:" default answer defaultFileName)
tell application "Finder"
activate
if the (count of windows) is not 0 then
set theFolder to (folder of the front window) as text
set theFolder to POSIX path of theFolder
else
set theFolder to POSIX path of (get path to desktop)
@jimmitchell
jimmitchell / a_button.css
Created August 16, 2011 17:07
CSS Button Style
/* css styles to create nice buttons out of anchor tags */
a.button {
border: 1px solid #bbb;
background: #ddd;
background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ccc));
background: -moz-linear-gradient(top, #eee, #ccc);
padding: 6px 15px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
@jimmitchell
jimmitchell / cm_custom.css
Created September 2, 2011 14:55
Custom CSS for Use With Chrome Minimalist for Google Calendar
#calendars_my div[class='calListRow']:last-child {display:none !important;}
div[id='currentDate:0'] {font-weight: bold;font-size:1.26em;}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove the silly WordPress Emoji stuff...
function mnmlst_disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
@jimmitchell
jimmitchell / Faux Visualforce Required Field.html
Last active July 3, 2016 00:19
Force.com Apex code for making a field appear to be required on a Visualforce page.
<!-- update "Object_Name__c" with your Object, and "Field_Name__c" with your Field -->
<apex:pageblocksectionitem helpText="{!$ObjectType.Object_Name__c.Fields.Field_Name__c.inlineHelpText}">
<apex:outputlabel value="{!$ObjectType.Object_Name__c.fields.Field_Name__c.label}" />
<apex:outputpanel layout="block" styleClass="requiredInput">
<apex:outputpanel layout="block" styleClass="requiredBlock"/>
<apex:inputfield value="{!Object_Name__c.Field_Name__c}" />
</apex:outputpanel>
</apex:pageblocksectionitem>
<?php
// Gets the year of your first published post, the current year, and displays the year range between them.
// If both are the same year, just displays current year. Change "slug" to your theme's domain.
function slug_copyright() {
$fp_get_all = get_posts( array(
'numberposts' => 1,
'post_status' => 'publish',
'order' => 'ASC'
) );
<?php
// Change the page title separator.
// change "slug" to your theme's domain
function slug_document_title_separator( $sep ) {
$sep = ":";
return $sep;
}
add_filter( 'document_title_separator', 'slug_document_title_separator' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Exclude pingbacks from comment count
// change "slug" to your theme's domain
function slug_comment_count( $count ) {
global $id;
$comment_count = 0;
$comments = get_approved_comments( $id );
foreach ( $comments as $comment ) {
@jimmitchell
jimmitchell / Minimalist-Mailplane-3-Style.css
Last active May 31, 2018 20:09
Minimalist Mailplane 3 Style
/* Hide switcher */
div.aki.pp {
visibility: hidden;
}
/* Hide compose button */
/*
div.aic {
display: none;
}