Skip to content

Instantly share code, notes, and snippets.

View reubeningber's full-sized avatar

Reuben Ingber reubeningber

View GitHub Profile
@reubeningber
reubeningber / ko.bindingHandlers.fadeVisible.js
Created October 2, 2014 14:15
KO - Bindings - fadeVisible
ko.bindingHandlers.fadeVisible = {
init: function(element, valueAccessor) {
// Start visible/invisible accoring to initial value
var shouldDisplay = valueAccessor();
$(element).toggle(shouldDisplay);
},
update: function(element, valueAccessor) {
// On update fade in/out
var shouldDisplay = valueAccessor();
shouldDisplay ? $(element).fadeIn() : $(element).fadeOut();
@reubeningber
reubeningber / smoothScroll.js
Created September 9, 2014 21:55
Smooth Scrolling for in page links
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
$.waypoints('disable');
var target = $(this.hash);
$('.site-nav li').removeClass('active');
$(this).parent().addClass('active');
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
var scrollPosition = target.offset().top - 115;
@reubeningber
reubeningber / Browser Frame
Created August 18, 2014 15:41
This is a browser frame in HTML / CSS
<style>
body {
text-align: center;
}
.browser-frame {
border-radius: 5px;
border: 2px solid #CCC;
width: 100%;
margin: 0 auto;
@reubeningber
reubeningber / hero-unit.less
Last active August 29, 2015 14:05
Hero Unit
/*-------------------------------------------- */
/** Hero Unit */
/*-------------------------------------------- */
.hero-unit {
position: relative;
width: 100%;
height: 455px;
&.services {
@reubeningber
reubeningber / TeuxDeux Snippet
Last active December 31, 2015 23:39
Assortment of Text Expander Snippets for the popular to do list app [TeuxDeux](http://teuxdeux.com)
Shortcode: htitle
Snippet: =========== **%fill:Header Title%** ===========
Result: =========== **Header** ===========
Shortcode: tline
Snippet: ==============================
Result: ==============================
Shortcode: startask
Snippet: **★ %fill:Starred To Do Item%**