Skip to content

Instantly share code, notes, and snippets.

View rinatkhaziev's full-sized avatar
🤖
Cache rules everything around me

Rinat K rinatkhaziev

🤖
Cache rules everything around me
View GitHub Profile
@jeremyfelt
jeremyfelt / google-dfp-acm-config.php
Created August 23, 2012 21:23
Google DFP JS Explanation
<?php
/**
* Basic configuration for multiple DFP JS ad tags in Ad Code Manager
*
* Our ad units are named 'test_ad_300x250' and 'test_ad_728x90'
* Our DFP ID is 12345678
* Our ad slot IDs will be automatically created
*
*/
@mjangda
mjangda / s-maintenance-mode.php
Created August 16, 2012 14:28
Custom WordPress maintenance mode that allows super admins access to the Dashboard
<?php
add_action( 'init', 'x_maintenance_mode' );
function x_maintenance_mode() {
if ( defined( 'X_MAINTENANCE_MODE' ) && true === X_MAINTENANCE_MODE ) {
if ( is_super_admin() && is_admin() )
return;
die( 'Site is currently under maintenance' );
@sapegin
sapegin / footer.php
Created August 7, 2012 19:10
RequireJS in Wordpress theme
@lsauer
lsauer / gist:2907369
Last active January 17, 2022 09:59
Google Chrome special pages for memory, debug, resources, profiling, downloads...

####lsauer.com


###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per v20.xxx

@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@Viper007Bond
Viper007Bond / gist:2417309
Created April 18, 2012 23:20
Spotify, Rdio, and Gist embeds for WordPress
<?php
# Spotify
wp_embed_register_handler( 'spotify', '#https?://open\.spotify\.com/.*#', 'spotify_embed_handler' );
add_shortcode( 'spotify', 'spotify_shortcode' );
if ( get_option('embed_autourls') )
add_filter( 'the_content', 'spotify_embed_ids', 7 );
@kevinSuttle
kevinSuttle / meta-tags.md
Last active May 12, 2024 15:28 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@mjangda
mjangda / 0-env-url-override.php
Created January 18, 2012 22:46
How to use WordPress across environments without needing to mess with URLs in the database.
<?php
// This is the meat of the plugin and should go in mu-plugins/0-env-url-override.php
// Only load these filters if we're not in the production environment
if ( defined( 'ENV_NOT_PRODUCTION' ) && ENV_NOT_PRODUCTION ) {
// This always needs to be filtered
add_filter( 'site_url', 'env_filter_site_url', 0 );
// We don't filter home_url in the admin so that we get production URLs for posts.
// This does break certain links like "Preview/View Post", however.