Commands to get commit statistics for a Git repository from the command line -
using git log
, git shortlog
and friends.
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
:root { | |
--violation-color: red; /* used for clear issues */ | |
--warning-color: orange; /* used for potential issues we should look into */ | |
} | |
/* IMAGES */ | |
/* | |
* Lazy-Loaded Images Check | |
* ==== |
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 | |
// Put this in wp-config.php and replace https://example.com/ with the URL of the production site. | |
define( 'RH_USE_REMOTE_MEDIA_URL', 'https://example.com/' ); | |
// Put the rest of this in functions.php or a custom plugin or somewhere else. | |
if ( defined( 'RH_USE_REMOTE_MEDIA_URL' ) && ! empty( RH_USE_REMOTE_MEDIA_URL ) ) { | |
add_filter( 'wp_get_attachment_image_src', 'filter_wp_get_attachment_image_src' ); | |
add_filter( 'wp_calculate_image_srcset', 'filter_wp_calculate_image_srcset' ); | |
add_filter( 'wp_get_attachment_url', 'filter_wp_get_attachment_url' ); | |
} |
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
/// poly-fluid-sizing | |
/// Generate linear interpolated size values through multiple break points | |
/// @param $property - A string CSS property name | |
/// @param $map - A SASS map of viewport unit and size value pairs | |
/// @requires function linear-interpolation | |
/// @requires function map-sort | |
/// @example | |
/// @include poly-fluid-sizing('font-size', (576px: 22px, 768px: 24px, 992px: 34px)); | |
/// @author Jake Wilson <jake.e.wilson@gmail.com> | |
@mixin poly-fluid-sizing($property, $map) { |
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 | |
/** | |
* Change the default for a dropdown to "red" if a specific user meta key is set for current user | |
*/ | |
add_filter( 'caldera_forms_render_field_structure', function( $field_structure, $form ){ | |
//make sure to change field ID to your field's ID here! | |
//not that $field_structure is not the same as field config, but that is stored in $field_structure[ 'field' ] | |
if( 0 != get_current_user_id() && 'fld_1234' == $field_structure[ 'field' ][ 'ID' ] ) { | |
if( 'red' == get_user_meta( get_current_user_id(), 'color', true ) ){ | |
$field_structure[ 'default' ] = 'red'; |
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 // Don't copy this line if you are inserting in a file that has it already. | |
/** | |
* ACF Options Page | |
* | |
* Instructions: | |
* Add more languages to the array below: $languages | |
* | |
* @author: Zeshan Ahmed <https://zeshanahmed.com/> | |
*/ |
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
#!/bin/bash | |
# Install Wordpress with Square Candy default using WP CLI | |
read -p 'Site URL (example.com): ' url | |
read -p 'Site Title: ' title | |
read -p 'WP Admin username: ' admin_user | |
read -sp 'WP Admin password: ' admin_password | |
read -p ' | |
WP Admin email: ' admin_email | |
read -p 'Database name: ' dbname | |
read -p 'Database user: ' dbuser |
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 | |
// Heartbeat-Schnittstelle komplett abschalten | |
add_action('init', 'stop_heartbeat', 1); | |
function stop_heartbeat() | |
{ | |
wp_deregister_script('heartbeat'); | |
} | |
// Heartbeat-Schnittstelle außerhalb der Beiträge abschalten |
SSH into your server and stay in the home directory of the user.
Check if you have a bin
directory in your user directory already, in case you do, omit the mkdir bin
.
For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc
. For the new config to be used run source ~/.bashrc
or close and reopen your SSH session.
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
/** | |
* Meta Box { Conditional Logic | |
* | |
* @description: hide / show fields based on a "change" field | |
* @created: 12/21/14 | |
*/ | |
add_action('admin_head', 'non_acf_conditional_logic'); | |
if (!function_exists('non_acf_conditional_logic')) { | |
function non_acf_conditional_logic(){ | |
global $current_screen; |
NewerOlder