Skip to content

Instantly share code, notes, and snippets.

View krzysu's full-sized avatar

Kris Urbas krzysu

View GitHub Profile
@krzysu
krzysu / document_title.coffee
Created February 4, 2013 15:17
manage document title to set info about number of notifications
# manage document title
Title =
regex: /\(\d*\) \| /
# set number of new items in document title
set: (number) ->
# update value
if document.title.match(@regex)?
document.title = document.title.replace(@regex, '(' + number + ') | ')
@krzysu
krzysu / wp_rss_feed.php
Created January 30, 2013 11:55
Wordpress: display N posts on static page from RSS source
<?php
$rss = fetch_feed( 'http://www.ondango-labs.com/feed/' );
if (!is_wp_error( $rss ) ) :
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<div class="three-from-four" id="latest-posts-box">
@krzysu
krzysu / wp_feed.php
Last active December 11, 2015 22:58
Wordpress: display last N posts on static page
<?php
$args = array( 'numberposts' => 2, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
$recentposts = get_posts( $args );
if( empty( $recentposts )):
?>
<div class="three-from-four" id="latest-posts-box">
<?php
#menu {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAARCAYAAAAyhueAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACVJREFUeNpi/A8EDFQGTAw0ADQxdBRQHzCOJqlRMJqkqAgAAgwAxggMBCM7bBAAAAAASUVORK5CYII=");
background-repeat: no-repeat;
background-position: center center;
background-color: #111;
width: 50px;
height: 50px;
}
@krzysu
krzysu / gist:3312470
Created August 10, 2012 07:52
get to the events data for debugging purposes
$._data(element, "events")
@krzysu
krzysu / color_palete.coffee
Created July 26, 2012 14:27
color palete generator
class ColorPalete
constructor: ->
@colors =
'blue': [
'0D2861'
'133783'
'3A5897'
'6179AC'
'96A3C3'
'A7B1CD'
@krzysu
krzysu / _media.scss
Created April 12, 2012 10:46
scss media type informer
@mixin media-informer {
position: fixed;
right: 0;
top: 0;
background: #000;
color: #fff;
padding: 6px 12px;
}
@media only screen and (max-width : 480px) {