Skip to content

Instantly share code, notes, and snippets.

View reformatco's full-sized avatar

Reformat reformatco

View GitHub Profile
<?php
/**
* Adds a title attribute to iframe oembeds
*
* @since 1.0.0
*
* @param string $html HTML
* @param string $url URL to embed
* @param array $attributes HTML Attributes
* @param int $post_id Post ID
@morgyface
morgyface / functions_crop-images.php
Last active January 31, 2024 10:29
WordPress | Create checkboxes on Settings > Media which crop medium and large image sizes.
// Add crop options for medium and large images to dashboard > settings > media.
function crop_settings_api_init() {
// Add the section to media settings
add_settings_section(
'crop_settings_section',
'Crop images',
'crop_settings_callback_function',
'media'
);
// Add the fields to the new section
@Daniel15
Daniel15 / 1_Twitter autoresponder bot.md
Last active December 6, 2021 20:37
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@bru
bru / texmate_dot_filter
Created June 12, 2010 09:14
TextMate dotfiles filter
# TextMate dotfiles filter
# use this filter in Preferences -> Advanced -> Folder References -> File Pattern
# to show .gitignore, .gems (useful for Heroku), .bundle in your project
!(/\.(?!(htaccess|gitignore|gems|bundle))[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$