Skip to content

Instantly share code, notes, and snippets.

Avatar

Antonio Laguna Antonio-Laguna

View GitHub Profile
View Discover Scroll Overflow
javascript:(function(d){var w=d.documentElement.offsetWidth,t=d.createTreeWalker(d.body,NodeFilter.SHOW_ELEMENT),b;while(t.nextNode()){b=t.currentNode.getBoundingClientRect();if(b.right>w||b.left<0){t.currentNode.style.setProperty('outline','1px dotted red','important');console.log(t.currentNode);}};}(document));
@Antonio-Laguna
Antonio-Laguna / concurrency.js
Created Jan 19, 2017
Limit concurrency with RxJS
View concurrency.js
// limits a stream to `limit` active events
function limitStream(input$, outputComplete$, limit = 10) {
const initialOutputLimiter$ = Rx.Observable.range(1, limit).map(x => true);
// a stream of bools indicating when to pass the next input to the output stream
const outputLimiter$ = Rx.Observable.concat(initialOutputLimiter$, outputComplete$);
return Rx.Observable.zip(outputLimiter$, input$);
}
@Antonio-Laguna
Antonio-Laguna / functions.php
Last active Jun 15, 2020 — forked from kloon/functions.php
WooCommerce Dropdown Product Quantity, fully compatible with Min/Max quantities extension and working quantity
View functions.php
<?php
// Place the following code in your theme's functions.php file
// override the quantity input with a dropdown
// Note that you still have to invoke this function like this:
/*
$product_quantity = woocommerce_quantity_input( array(
'input_name' => "cart[{$cart_item_key}][qty]",
'input_value' => $cart_item['quantity'],
'max_value' => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(),
'min_value' => '0'
View DB.sql
CREATE TABLE `makers` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
View dabblet.css
/**
* Ey, eligeme a mi!
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
View dabblet.css
/**
* Ring ring!
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
@Antonio-Laguna
Antonio-Laguna / dabblet.css
Created Dec 26, 2012
Sencilla animación CSS
View dabblet.css
/**
* Sencilla animación CSS
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
@Antonio-Laguna
Antonio-Laguna / dabblet.css
Created Dec 26, 2012
Sencilla animación CSS
View dabblet.css
/**
* Sencilla animación CSS
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
@Antonio-Laguna
Antonio-Laguna / dabblet.css
Created Dec 26, 2012
Sencilla transición CSS
View dabblet.css
/**
* Sencilla transición CSS
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
@Antonio-Laguna
Antonio-Laguna / dabblet.css
Created Dec 17, 2012
Sencilla transición CSS
View dabblet.css
/**
* Sencilla transición CSS
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;