Skip to content

Instantly share code, notes, and snippets.

View yurimatheus's full-sized avatar
📱
<coding />

Yuri Matheus Gomes yurimatheus

📱
<coding />
View GitHub Profile
@rajraj
rajraj / 01. Gemfile
Created July 19, 2011 09:30 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@mikejolley
mikejolley / gist:2044101
Last active October 28, 2024 06:14
WooCommerce - Show number of items in cart and total
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@kloon
kloon / gist:4218605
Created December 5, 2012 19:13
WooCommerce Product Count Shortcode
// [product_count] shortcode
function product_count_shortcode( ) {
$count_posts = wp_count_posts( 'product' );
return $count_posts->publish;
}
add_shortcode( 'product_count', 'product_count_shortcode' );
@krogsgard
krogsgard / wp-query-the-right-way.php
Last active January 4, 2021 21:59
sample custom WP_Query the right way
<?php
/*
* WP_Query happy dance
*
* this is a sample WP_Query the right way
*/
$args = array (
'post_type' => 'post',
@alancpazetto
alancpazetto / ionic.popup.material.scss
Last active September 16, 2019 04:07
Ionic Framework Popup Material Design (SCSS)
$buttonsColor : #2196f3;
.popup-container{
.popup{
padding-top: 5px;
padding-left: 10px;
background: #fafafa;
-webkit-box-shadow: 0 10px 30px 0 rgba(0,0,0,.3);
box-shadow: 0 10px 30px 0 rgba(0,0,0,.3);
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
# Utilize-o em 'config/locales/', com o nome de 'devise.pt-BR.yml'.
# Em 'config/application.rb', utilize => config.i18n.default_locale = :'pt-BR'
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso."
send_instructions: "Você receberá um e-mail para confirmar sua conta em alguns minutos."
@ajskelton
ajskelton / WP Customizer - Checkbox
Last active May 14, 2024 04:54
Add a Checkbox field to the WordPress Customizer.
$wp_customize->add_setting( 'themecheck_checkbox_setting_id', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'themeslug_sanitize_checkbox',
) );
$wp_customize->add_control( 'themeslug_checkbox_setting_id', array(
'type' => 'checkbox',
'section' => 'custom_section', // Add a default or your own section
'label' => __( 'Custom Checkbox' ),
'description' => __( 'This is a custom checkbox input.' ),
@DanielSantoro
DanielSantoro / ajaxify-cart.php
Last active November 22, 2022 13:34
AJAX Update Cart thats added to Template File Manually (
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php).
// Used in conjunction with https://gist.github.com/DanielSantoro/1d0dc206e242239624eb71b2636ab148
// Compatible with WooCommerce 3.0+. Thanks to Alex for assisting with an update!
function woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
?>
@thulioph
thulioph / service-worker.js
Created March 16, 2017 06:31
service worker example
(function() {
'use strict';
var cacheName = 'cache_v2.0';
var cacheFiles = [
'./',
'./index.html',
'./sw.js',
'./manifest.json',
'./src/assets/js/libs/sweetalert.min.js',