Skip to content

Instantly share code, notes, and snippets.

@jq-87
jq-87 / _box-settings.scss
Created October 5, 2014 21:29
3d box with sass map
//colors
$turquoise: #1abc9c;
$amethyst: #9b59b6;
$silver: #bdc3c7;
$emerland: #2ecc71;
$white: white;
$black: black;
//dimensions
$size: 100px;
@jq-87
jq-87 / even-rows.scss
Created March 11, 2014 16:53
even rows (4 column)
&:nth-child(4n + 1):nth-last-child(2),
&:nth-child(4n + 2):nth-last-child(1) {
width: 49%
}
&:nth-child(4n + 1):nth-last-child(3),
&:nth-child(4n + 2):nth-last-child(2),
&:nth-child(4n + 3):nth-last-child(1) {
width: 33.24%;
}
@jq-87
jq-87 / Reached_the_bottom.js
Created December 2, 2013 16:43
Detect when scroll position is at the bottom of page
$(window).scroll(function(){
var pageHeight = $(document).height(),
windowHeight = $(window).height(),
topDistance = $(document).scrollTop();
if( pageHeight - topDistance == windowHeight) {
//load more content now
console.log('reached the bottom');
//source: http://www.dangayle.com/import-feeds-wordpress-fetch-feed/
function custom_rss($feedUrl = 'http://wordpress.org/news/feed/'){
include_once(ABSPATH . WPINC . '/rss.php');
$feed = $feedUrl;
$rss = fetch_feed($feed);
if (!is_wp_error( $rss ) ) :
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);