Skip to content

Instantly share code, notes, and snippets.

View abrcoelho's full-sized avatar

Abraão Coelho abrcoelho

  • Tech Lead
  • Belo Horizonte, MG, Brasil
  • X @abrcoelho
View GitHub Profile

Premises

The first step is to get your "now" date properly formatted!

{% assign today = "now" | date: "%s" %}

"You're so nice" check

In this scenario I used a custom field named last_week_donation to retrieve the last donation date. The value in the database is "2020-05-15" (today is the 17th).

function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));
@abrcoelho
abrcoelho / findPHPFilesWithTrailingWhitespace.sh
Last active September 8, 2015 21:36 — forked from AlexChittock/findPHPFilesWithTrailingWhitespace.sh
Find PHP files with trailing whitespace
find . -name "*.php" | xargs grep -c -P '\s+$' | grep -v ':0$'

Create Linode: Ubuntu LTS

Gaining SSH Access

  1. Login with set password
  2. mkdir ~/.ssh
  3. chmod go-w ~/.ssh
  4. exit
  5. scp /.ssh/id_rsa.pub SERVER:/.ssh/authorized_keys
<div class="galleries workgroups touchcarousel black-and-white">
<ul class="touchcarousel-container">
<% collection.each do |resource| %>
<li class="touchcarousel-item">
<%= link_to resource, { :title => "", "data-placement" => "bottom", :class => "thumbnail" } do %>
<%= workgroup_cover(resource) %>
<% end %>
</li>
<% end %>
</ul>
#!/usr/bin/env ruby
require 'rubygems'
require 'simple-rss'
url = File.open('ezrss.xml') # XML file from the RSS feed stored locally during development to avoid "too many requests" error.
rss = SimpleRSS.parse open(url)
TVSHOWS = %w[
Alphas
<div class="product-summary">
<?php
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
/* remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); */
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
?>
<table>
<tr>
<td> Abraão </td>
<td> 123456 </td>
</tr>
<tr>
<td> Leo </td>
<td> 654321 </td>
</tr>
</table>
var currentURL = window.location.pathname;
$('.tabs a, .main-nav a, .touchcarousel a').each(function(index, element){
path = element.pathname;
if(currentURL.match(path)){ $(element).addClass('current'); }
});
pt-BR:
date:
abbr_day_names:
- Dom
- Seg
- Ter
- Qua
- Qui
- Sex
- Sáb