Skip to content

Instantly share code, notes, and snippets.

View anyssa's full-sized avatar

Anyssa Ferreira anyssa

View GitHub Profile
@sparkalow
sparkalow / find-wide-dom-elements.js
Created April 27, 2016 16:31
Useful JS snippet for finding DOM elements wider than current viewport. Only tested in Chrome.
var els = document.querySelectorAll('*');
var l = els.length;
var maxWidth = window.innerWidth;
console.log('Elements wider than ' + maxWidth);
for(var i = 0 ; i < l; i ++){
var e = els[i];
var width =e.offsetWidth;
rect = e.getBoundingClientRect();
if(rect.width > maxWidth){
@BurlesonBrad
BurlesonBrad / functions.php
Created March 10, 2016 21:34 — forked from TimBHowe/functions.php
Reduce or remove WooCommerce 2.5 minimum password strength requirement for creating a user account. Warning: Use at your own risk.
<?php
/**
*Reduce the strength requirement on the woocommerce password.
*
* Strength Settings
* 3 = Strong (default)
* 2 = Medium
* 1 = Weak
* 0 = Very Weak / Anything
*/
@chrdesigner
chrdesigner / functions.php
Last active July 30, 2018 20:52
Vender Somente para Estado Específico - WooCommerce
<?php
/**
* Brazillian states
* Function - Vender Somente para Estados Específicos - WooCommerce
*/
function wc_especifico_estado( $states ) {
$states['BR'] = array(
'SP' => __( 'S&atilde;o Paulo', 'woocommerce' ),
'RJ' => __( 'Rio de Janeiro', 'woocommerce' ),
);
@griiettner
griiettner / Bootstrap Smooth Scroll to Anchor
Last active November 1, 2017 14:23
Bootstrap Smooth Scroll to Anchor
!function ($) {
$(function(){
$('#home, #me, #footer').carousel({});
var $root = $('html, body');
$('a').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top