Skip to content

Instantly share code, notes, and snippets.

View toledox82's full-sized avatar
🏠
Working from home

Marcio Toledo toledox82

🏠
Working from home
View GitHub Profile
@toledox82
toledox82 / product-card-grid.liquid
Created May 22, 2020 02:48
Shopify: Add product options (variants) on product listing
{% if product.options[0] == 'Size' %}
<small>Sizes:
{% for sizes in product.options_by_name['Size'].values %}
{% if forloop.last == true %}
{{ sizes }}
{% else %}
{{ sizes | append: ', ' }}
{% endif %}
{% endfor %}
</small>
@toledox82
toledox82 / dreamhost-deploy.md
Last active December 9, 2020 00:49 — forked from LosAlamosAl/dreamhost-deploy.md
Deploy a GitHub-based static site to Dreamhost

Before begining, make sure your SSH keys are set so you can ssh to your Dreamhost account.

Mac

$ ssh-copy-id -i ~/.ssh/id_rsa.pub username@domain.com
$ ssh username@domain.com

Windows

$ scp ~/.ssh/id_rsa.pub [user]@[hostname]:~/.ssh/authorized_keys
@toledox82
toledox82 / App.js
Created April 9, 2018 09:23
React Element, Stateless Component, Stateful Component
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
// Element
const Elemento = <h1>Hello World!</h1>
// Functional Stateless Component
const Component1 = (props) => {
return <span>{props.name}</span>
@toledox82
toledox82 / mailchimp.php
Last active July 21, 2023 18:06
PHP cURL function to add subscriber to MailChimp API 3.0
<?php
$data = [
'email' => $email,
'status' => 'subscribed',
'firstname' => $fname,
'lastname' => $lname
];
function syncMailchimp($data) {
$apiKey = 'XXX';
@toledox82
toledox82 / estados.txt
Last active February 16, 2018 22:49
Estados Brasileiros
Acre
Alagoas
Amapá
Amazonas
Bahia
Ceará
Distrito Federal
Espírito Santo
Goiás
Maranhão
@toledox82
toledox82 / .htaccess
Last active February 16, 2018 23:38
My default .htaccess
RewriteEngine On
# RewriteBase /
# Force SSL and Non-WWW for main domain (except local)
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.br$ [NC]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://domain.com.br%{REQUEST_URI} [R=301,L,NE]
### Remove .php
@toledox82
toledox82 / index.html
Last active October 1, 2016 02:22
HTML5 Start
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="author" content="Toledo Interactive" />
<meta name="designer" content="Marcio Toledo" />
// Live Search
function liveSearch() {
// Active tab All
if ($('#search-filter').val() == '') {
$('#filter-all').addClass('active');
} else {
$('.tabs .button').removeClass('active');
}
// Live Search
function liveSearch() {
// Retrieve the input field text and reset the count to zero
var filter = $('#search-filter').val(), count = 0;
// Loop through the comment list
$(".main-list li").each(function(){
// If the list item does not contain the text phrase fade it out
@toledox82
toledox82 / slider.js
Last active December 10, 2015 14:29
JavaScript: jQuery Slider 3
/*!
* Toledo Interactive jQuery Slider Script III
* Developed for http://inteface.eng.br
*
* Copyright 2012, Toledo Interactive
* http://toledointeractive.com/
*
* Usage: Slider.init();
*
*/