Skip to content

Instantly share code, notes, and snippets.

Avatar
🥳

Erick Olivares erickolivares

🥳
View GitHub Profile
View email-notification.html
<!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;
View regex-shortcut.md

Sentence Case

find:

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

replace:

$1\L$2

View Active Nav tabs, activated on scroll
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 Aug 3, 2017
Ingrid White Consulting
View Saved Content
<!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>
View WP Add Option to Crop Medium Image
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(
View WP Add Option to Crop Medium Image
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 Sep 19, 2016
Center the Mailchimp's rewards sticker in your email
View center-mailchimp-sticker
<html>
<head>
<style>
/** THE CSS **/
.mc-rewards {
text-align: center !important;
width: 100% !important;
margin: 0 auto !important;
width: 112px;
}
View Removes ?ver from WP
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 );
View gulpfile.js
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())
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var watch = require('gulp-watch');
var minify = require('gulp-minify-css');
var rename = require('gulp-rename');
var header = require('gulp-header');
var pkg = require('./package.json');
var sourcemaps = require('gulp-sourcemaps');
/* Prepare banner text */