Skip to content

Instantly share code, notes, and snippets.

View johnheimkes's full-sized avatar
🤝
Looking for work!

John Heimkes IV johnheimkes

🤝
Looking for work!
  • Minneapolis, MN
View GitHub Profile
@jesgs
jesgs / login-styles-removal.php
Last active August 29, 2015 14:23
A method for removing all default styles from WordPress login screen.
<?php
/**
* Remove all WordPress-specific stylesheets from WordPress login screen
*/
/**
* Force-remove login-related styles. Can't use the regular method of login_enqueue_scripts
* due to wp_admin_css running before login_enqueue_scripts
*
<?php
function ag_show_me_hooks() {
global $wp_current_filter;
var_dump( $wp_current_filter );
}
add_action( 'all', 'ag_show_me_hooks' );
@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
<?php
/**
* Modify WP_Query to return taxonomy fields in post array
*
* @author Jess Green <jgreen AT psy-dreamer.com>
*/
add_filter('posts_orderby', 'taxonomy_orderby');
add_filter('posts_fields', 'taxonomy_archive_select_fields');
add_filter('posts_join', 'taxonomy_archive_join');
@mustardBees
mustardBees / functions.php
Last active October 4, 2024 13:37
Filter a few parameters into WordPress YouTube oEmbed requests. Enable modest branding which hides the YouTube logo. Remove the video title and uploader information. Prevent related videos from being shown once the video has played.
<?php
/**
* Filter a few parameters into YouTube oEmbed requests
*
* @link http://goo.gl/yl5D3
*/
function iweb_modest_youtube_player( $html, $url, $args ) {
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html );
}
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 );
@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
<?php
add_filter('gform_field_content', 'add_placeholder_attr', 10, 3);
/**
* Add a placeholder attribute to text inputs
*
* @param string $content
* @param array $field
* @param mixed $value
@deanrather
deanrather / get-timezone.php
Last active March 22, 2018 15:49
Get Timezone with PHP
<?php
echo getTimezone("Sydney");
function getTimezone($location)
{
$location = urlencode($location);
$url = "http://maps.googleapis.com/maps/api/geocode/json?address={$location}&sensor=false";
$data = file_get_contents($url);
// Get the lat/lng out of the data
$data = json_decode($data);
@chrisdigital
chrisdigital / Frontend user profile in WordPress
Created May 6, 2013 13:27
Setting up a editable user profile in WordPress on the frontend.
//How to edit a user profile on the front end?
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end
//Forcing nickname as display_name in custom edit profile template
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template
///////
<?php
@jesgs
jesgs / walker-category.php
Last active December 11, 2015 16:18
Add checkboxes to categories using a Walker class and wp_list_categories
<?php
/**
* My Project
*
* @package MyProject
* @subpackage JesGs_Walker_Category
* @author Jess Green <[email protected]>
* @version $Id$
*/