Skip to content

Instantly share code, notes, and snippets.

@kobake
kobake / git-commit-size.sh
Created November 5, 2017 13:42
Calculate size of a git commit object.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: git-commit-size.sh <commit hash>" 1>&2
exit 1
fi
HASH=$1
ITEM_LIST="`git diff-tree -r -c -M -C --no-commit-id $HASH`"
@macbleser
macbleser / wp-permissions-script
Created February 21, 2014 15:37
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@ramseyp
ramseyp / custom_comments.php
Last active November 20, 2024 12:14
Different ways of customizing the WordPress comment form
<?php
// Customized the comment form fields ( not the comment text area )
add_filter('comment_form_default_fields', 'my_comment_form_args');
// Customizes the text area - you have to do this here, rather than in comment_form_default_fields
add_filter('comment_form_field_comment', 'my_comment_form_field_comment');
// Customized the comment notes above the form fields
add_filter( 'comment_form_defaults', 'my_comment_form_defaults' );