Skip to content

Instantly share code, notes, and snippets.

View renatocontaifer's full-sized avatar

Renato Contaifer renatocontaifer

View GitHub Profile
@renatocontaifer
renatocontaifer / gist:c5ffe6db4482f567b779
Last active August 29, 2015 14:15
Middleman navigation between posts
<ul>
<li class="previous">
<%= prev_article = current_article.previous_article %>
<% if prev_article %>
<%= link_to 'Projeto Anterior', '', :href => prev_article.url, :class => 'btn btn-projeto' %>
<% end %>
</li>
<li class="next">
<%= next_article = current_article.next_article %>
@renatocontaifer
renatocontaifer / scroll-to-section
Created February 18, 2015 13:06
Scroll to Section jQuery - by CSS Tricks
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
@renatocontaifer
renatocontaifer / middleman-navigation.slim
Created February 16, 2015 02:03
Middleman Article Navigation
ul
li.previous
- prev_article = current_article.previous_article
- if prev_article
a href="#{prev_article.url}" rel="prev" title="Previous article: #{prev_article.title}" Previous
li.next
- next_article = current_article.next_article
- if next_article
a href="#{next_article.url}" rel="next" title="Next article: #{next_article.title}" Next
<?php
$args = array(
'post_type' => "eventos",
'posts_per_page' => -1,
'meta_key' => 'data',
'orderby' => 'data',
'order' => 'ASC'
);
setlocale( LC_ALL, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8', 'portuguese' );
date_default_timezone_set( 'America/Sao_Paulo' );