Skip to content

Instantly share code, notes, and snippets.

View erickolivares's full-sized avatar
🥳

Erick Olivares erickolivares

🥳
View GitHub Profile
// Put this in wp-config.php and replace https://example.com/ with the URL of the production site.
define( 'RH_USE_REMOTE_MEDIA_URL', 'SITE URL' );
// 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' );
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Personal Email</title>
<style>
body{
background-color:#CCCCCC;

Sentence Case

find:

([A-Z])([A-Z]+)\b

replace:

$1\L$2

jQuery(document).ready(function( $ ) {
var modId = $(".main-content .row > div"); //divs with ID's
var navItems = $(".custom-nav li"); //nav items li
var points = [];
for (var i = 0; i < modId.length; i++) {
var thismod = modId.eq([i]);
var thismodID = thismod.attr("id")
@erickolivares
erickolivares / Saved Content
Created August 3, 2017 20:44
Ingrid White Consulting
<!DOCTYPE html>
<!--[if lt IE 7]><html lang="en-US" class="no-js ie-fix"> <![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html lang="en-US" class="no-js ie-fix"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html lang="en-US" class="no-js ie-fix"><![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-US" class="no-js"><!--<![endif]-->
<head><script type="text/javascript" src="/static/js/analytics.js?v=1500596387.0" charset="utf-8"></script>
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
add_settings_field(
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
add_settings_field(
@erickolivares
erickolivares / center-mailchimp-sticker
Last active September 19, 2016 17:39
Center the Mailchimp's rewards sticker in your email
<html>
<head>
<style>
/** THE CSS **/
.mc-rewards {
text-align: center !important;
width: 100% !important;
margin: 0 auto !important;
width: 112px;
}
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 1000 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 1000 );
@erickolivares
erickolivares / gulpfile.js
Last active February 5, 2016 23:29
Gulp JS SASS
var gulp = require('gulp'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps');
var input = './scss/**/*.scss',
output = './css';
gulp.task('sass', function () {
return gulp.src(input)
.pipe(sourcemaps.init())