Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en" class="no-js">
<!-- the "no-js" class is for Modernizr. -->
<head class="html5reset-kitchensink-commented">
<meta charset="utf-8" />
<!-- This prevents the conditional comments below from holding up the page load
@k33
k33 / twitter-feed.php
Created March 24, 2011 20:36
twitter feed in PHP
<?php
$url = 'http://twitter.com/statuses/user_timeline/224195473.rss';
$cache_expire = 3600; // in seconds
$ts = time();
$info_file = 'cashed/twitter/tmp-info.txt';
$cache_file = 'cashed/twitter/tmp-'.$ts.'.xml';
// current info
@k33
k33 / holding-page-head.js
Last active August 29, 2015 14:06
Holding Page Head for Bread & Butter (https://github.com/multiple-states/bread-butter)
<!-- Move to your custom.js file -->
$(window).on( 'resize', function () {
var viewportHeight = $(window).height();
var headHeight = $(".center-head").height();
var customPadding = (viewportHeight-headHeight)/2;
$(".center-head").css({"padding-top": customPadding });
}).resize();
var map;
function initialize() {
// You need to set your latitude and longitude here
var myLatlng = new google.maps.LatLng(51.497951, -0.144491);
var isDraggable = $(document).width() > 480 ? true : false; // If document is wider than 480px, isDraggable = true, else isDraggable = false SRC - https://coderwall.com/p/pgm8xa
var mapOptions = {
zoom: 16,
.first-nav {
display: none;
}
@media (min-width: @break-1) {
.first-nav {
display: block;
.make-sm-column( 12 );
}
.first-nav {
display: none;
}
@media (min-width: @break-1) {
/* First level navigation */
.l-first-nav-strip {
position: fixed;
left: 0;
@k33
k33 / menu-flyout.js
Last active August 29, 2015 14:06
A flyout menu for Bread & Butter (https://github.com/multiple-states/bread-butter)
<!-- Move to your custom.js file -->
// Open and close the flyout menu
$(".m-menu-open a, .m-menu-close a").click(function(){
$(".page-holder").toggleClass("open", 500, "easeInOutQuart");
});
// When a link is clicked close the flyout menu before navigating to the new page
@k33
k33 / related-posts-loop.php
Last active August 29, 2015 14:19
Related WordPress custom posts and posts loop that excludes duplicates
@k33
k33 / related-posts-loop.php
Last active August 29, 2015 14:19
Loop for related posts by category
@k33
k33 / related-posts.php
Last active August 31, 2016 19:13
WordPress related custom posts and posts loop that excludes duplicates