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
-- Replace with the file you want to copy | |
set theFile to "Macintosh HD:Users:path:to:your:file.txt" | |
-- Replace with the target folder. Or just swap your username in to use the Desktop. | |
set theDestination to "Macintosh HD:Users:USERNAME:Desktop" | |
tell application "Finder" to duplicate theFile to theDestination |
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
tell application "System Events" | |
set frontmostApplication to name of the first process whose frontmost is true | |
end tell | |
-- The bounds are the top-left and bottom-right coordinates on your screen, eg. {x, y, x, y} | |
tell application frontmostApplication | |
set bounds of the first window to {15, 38, 1760, 995} | |
end tell |
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
-- Set path to your folder here, including trailing slash and quotes. | |
set pathtofolder to "~/Dropbox/Write/" | |
-- Set preferred text editor here, including quotes. | |
-- Works with TextEdit, TextMate, TextWrangler, and I assume most others. | |
set myEditor to "Textmate" | |
-- Assigns bash script to variablle `ss`. |
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 | |
/* Create, then reformat a timestamp for as far back as you want the query to go. | |
'-1 months' = 1 month ago */ | |
$date = strtotime('-1 months'); | |
$noearlier = date('Y-m-d G:i:s', $date); | |
/* Build the meta arguments */ |
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: Shortcode P-Fixer | |
Description: Remove empty paragraphs from shortcode output. | |
*/ | |
/* Original Code from Thomas Griffin | |
/* https://thomasgriffin.io/remove-empty-paragraph-tags-shortcodes-wordpress/ | |
*/ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
function cp_makeProfileFieldUneditable( $retval ) { | |
if( is_user_logged_in() && bp_is_profile_edit() ) { | |
$retval['exclude_fields'] = '1'; // field id's | |
} | |
return $retval; | |
} | |
add_filter( 'bp_after_has_profile_parse_args', 'cp_makeProfileFieldUneditable' ); |
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 | |
// Translating custom Beaver Builder Modules with WPML | |
// Runs a filter included in the WPML String Translation plugin | |
add_filter( 'wpml_beaver_builder_modules_to_translate', 'wpml_modules_to_translate_filter' ); | |
// Add each custom module to the $modules array, e.g. `custom-module-1` | |
function wpml_modules_to_translate_filter( $modules ) { | |
// Adding the first module. |
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 | |
/** | |
* Customizer Custom Fonts | |
* | |
* Add fonts to the BB Theme Customizer and BB Page Builder | |
* Fonts will be listed under "System" fonts in the drop downs | |
* | |
* Solution originally found here: | |
* https://www.warpconduit.net/2016/02/15/adding-custom-fonts-to-the-beaver-builder-child-theme-customizer/ |
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 CSS to Events Admin pages | |
*/ | |
add_action('admin_head', 'my_custom_fonts'); | |
function my_custom_fonts() { | |
// Get current screen if targeting post type is necessary |
OlderNewer