Skip to content

Instantly share code, notes, and snippets.

View jimmitchell's full-sized avatar

Jim Mitchell jimmitchell

View GitHub Profile
@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;}
@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>
@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 / 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;
}
@jimmitchell
jimmitchell / AppleScript to Toggle the Desktop.scpt
Last active June 8, 2023 14:17
AppleScript to Toggle the Desktop
tell application "System Events"
set frontMostApp to short name of the first process whose frontmost is true
end tell
try
set theDefault to ((do shell script "defaults read com.apple.finder CreateDesktop") as integer) as boolean
on error -- if the default value doesn't already exist, create it.
do shell script "defaults write com.apple.finder CreateDesktop 1"
set theDefault to ((do shell script "defaults read com.apple.finder CreateDesktop") as integer) as boolean
end try
do shell script "defaults write com.apple.finder CreateDesktop " & (((not theDefault) as integer) as string)
@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 / Compress_Files_or_Folders.scpt
Last active June 8, 2023 14:16
AppleScript to Compress Files or Folders in the macOS Finder
-- choose files or folders to archive since AppleScript can't seem to allow both at once...
set archiveOption to button returned of (display dialog "Archive files or folders?" buttons {"Cancel", "Folders", "Files"} default button 3)
-- now let's choose what we want to archive...
if archiveOption is "Files" then
set selectedItems to choose file with prompt "Select files you want to compress:" with multiple selections allowed
else if archiveOption is "Folders" then
set selectedItems to choose folder with prompt "Select folders you want to compress:" with multiple selections allowed
else if archiveOption is "Cancel" then
return
<?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' );
<?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 ) {