Example | Format |
---|---|
2021 | YYYY |
🦏 | 🦏 |
202108 | YYYYMM |
2021-08 | YYYY-MM |
🦏 | 🦏 |
8/5 | M/D |
08/05 | MM/DD |
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 | |
const ACTION_NAME = 'shea_ajax_example'; | |
$handler = function () { | |
check_ajax_referer( ACTION_NAME ); | |
wp_send_json_success( 'it works!' ); | |
}; |
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 | |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
$plugins = array( | |
'wordpress-seo/wp-seo.php', | |
'broken-link-checker/broken-link-checker.php' | |
); | |
if ( strpos(get_site_url(), 'devserver.com') !== false ) { | |
deactivate_plugins( $plugins ); | |
} | |
else { |
Put this function on the main php file of your dependent plugin and call it with the rigth parameters.
/**
* Verify if a plugin is active, if not deactivate the actual plugin an show an error
* @param [string] $my_plugin_name
* The plugin name trying to activate. The name of this plugin
* Ex:
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: Deactivate Certain Plugins - WPEngine Staging | |
Plugin URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633 | |
Description: Deactivate certain plugins in the development/staging environment of WP Engine. | |
Version: 1.0 | |
Author: Subharanjan | |
Author URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633 | |
License: GPLv2 | |
*/ |
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
# Close all notifications | |
my closeNotifications() | |
on closeNotifications() | |
tell application "System Events" to tell process "Notification Center" | |
set theWindows to every window | |
repeat with i from 1 to number of items in theWindows | |
set this_item to item i of theWindows | |
try | |
click button 1 of this_item |
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 dFolder to "~/Desktop/screencapture/" | |
do shell script ("mkdir -p " & dFolder) | |
set i to 0 | |
repeat 960 times | |
set tTime to do shell script "date +%H%M%S" | |
do shell script ("screencapture " & dFolder & "frame-" & i & ".png") | |
delay 30 -- Wait for 30 seconds. | |
set i to i + 1 |
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 dFolder to "~/Desktop/screencapture/" | |
do shell script ("mkdir -p " & dFolder) | |
set i to 0 | |
repeat 960 times | |
do shell script ("screencapture " & dFolder & "frame-" & i & ".png") | |
delay 30 -- Wait for 30 seconds. | |
set i to i + 1 | |
end repeat |
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
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559 | |
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder | |
--set theLines to paragraphs of theFileContents | |
set theLines to {"task name 1", "task name 2"} | |
repeat with eachLine in theLines | |
tell application "Reminders" | |
set mylist to list "Your List Name" | |
tell mylist | |
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"} |
NewerOlder