Skip to content

Instantly share code, notes, and snippets.

View adrianrodriguez's full-sized avatar
💭
Looking for work

Adrian Rodriguez adrianrodriguez

💭
Looking for work
View GitHub Profile
@adrianrodriguez
adrianrodriguez / .htaccess
Last active July 7, 2016 20:00
A problem finally solved. Redirecting non HTTP and non WWW to www and https for MAIN DOMAIN ONLY.
# We had a specific need for a client that wanted HTTPS for one domain but not subdomains
# that also ran a lot of sites locally. So we ran into an issue after launching without the www prefix.
# For days I looked for a solution and tried to get things working, with hours spent attempting many different ones.
# After so long and taking some time to work on another project I stumbled upon this article: https://www.siteground.com/kb/how_to_redirect_nonwww_urls_to_www/
# After sifting through the comments I found the first chunk of code below that did everything for the main domain, while keeping what I had below for the subdomains to redirect from HTTPS
# Also be sure the main blog is updated to http://www.domain.com in the wp_options table wherever applicable.
# for main domain
@adrianrodriguez
adrianrodriguez / stores.cshtml
Created July 11, 2013 18:07
Google Maps Api Store
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="container" id="map">
<div id="map-container">
<!-- RENDER MAP IN HERE -->
<?php
global $post;
$current_date = date('j M Y');
$end_date = $current_date;
$get_posts = tribe_get_events(array(
'start_date'=>$current_date,
'end_date'=>$end_date,
<div class="calendar-container">
<div class="top-arrow"><img src="<?php bloginfo('template_url'); ?>/images/top-arrow.png" alt="" /></div>
<ul>
<?php
global $post;
$current_date = date('j M Y');
$end_date = date('j M Y', strtotime('30 days'));
@adrianrodriguez
adrianrodriguez / single-post.php
Created June 26, 2013 21:01
Single post before with loop
<?php get_header(); ?>
<div class="container" id="content-container">
<div class="row content">
<div class="eightcol left-column promo">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>">
@adrianrodriguez
adrianrodriguez / single-event.php
Created June 26, 2013 20:58
Single Event page using Code from plugin
<?php
/**
* If 'Default Events Template' is selected in Settings -> The Events Calendar -> Theme Settings -> Events Template,
* then this file loads the page template for all for the individual
* event view. Generally, this setting should only be used if you want to manually
* specify all the shell HTML of your ECP pages in this template file. Use one of the other Theme
* Settings -> Events Template to automatically integrate views into your
* theme.
*
* You can customize this view by putting a replacement file of the same name (ecp-single-template.php) in the events/ directory of your theme.
$('li.physician').each(function(){
var web = $(this).children('.physician_web').text();
var shortText = jQuery.trim(web).substring(0, 50)
.trim(this) + "...";
var address = $(this).children('.physician_address').text();
address = address.replace(/\s{2,}/g, ' ');
address = address.replace(/ /g, '+');
$(this).children('.physician_web').attr('href', 'http://' + web);
<?php include('header.php'); ?>
<div class="container">
<div class="content row">
<section id="top" class="twelve columns">
<h5>Search for a Physician</h5>
<form action="physicians.php" method="get">
<div class="field">
<input type="text" name="q" class="text xwide input" placeholder="Search by: Physician, State or Zipcode">
@adrianrodriguez
adrianrodriguez / button.sass
Last active December 11, 2015 22:08
Weird syntax error with sass mixin.
@mixin button($color1, $color2, $padding, $size, $radius)
+background(linear-gradient(#{$color1}, #{$color2}))
color: $white
text-shadow: -1px 0px 0px $header
padding: #{$padding}
text-transform: uppercase
display: inline-block
text-align: center
font-size: #{$size}
cursor: pointer
$(function() {
// Get first element and find element within and hide
$(".grid_3:first").find(".prev").hide();
/// Get last element and find element within and hide
$(".grid_3:last").find(".next").hide();