Skip to content

Instantly share code, notes, and snippets.

View reubeningber's full-sized avatar

Reuben Ingber reubeningber

View GitHub Profile
@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%**
@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 / 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 / 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 / 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 / threeUp.less
Created October 17, 2014 19:46
ThreeUp.less
.three-up {
padding: 50px 0;
.clearfix();
}
.three-up-unit {
float: left;
margin: 0 25px 0 0;
.calc(width, ~'33% - 25px');
.box-sizing(border-box);
@reubeningber
reubeningber / fitTextHelper.js
Created October 20, 2014 18:33
FitText Helper
// FitText
// Add class js-fit-text & Set the following data-attributes: data-fit-compressor="<compressor value>" data-fit-max-font-size=<size>px" data-fit-min-font-size="<size>px"
$('.js-fit-text').each(function() {
var $this = $(this),
fitCompressor = $this.data('fit-compressor') || 1,
fitMaxFontSize = $this.data('fit-max-font-size') || Number.POSITIVE_INFINITY,
fitMinFontSize = $this.data('fit-min-font-size') || Number.NEGATIVE_INFINITY;
$this.fitText(fitCompressor, {maxFontSize: fitMaxFontSize, minFontSize: fitMinFontSize});
});
var POP_UP_WIDTH = 700,
POP_UP_HEIGHT = 500;
function init() {
$(document).on('click', '.js-share-pop-up', function(e) {
e.preventDefault();
var $this = $(this),
shareURL = $this.data('shareUrl'),
data = {
"customer_name": "businessinsider",
"user_name": "<REDACTED>",
"password": "<REDACTED>"
}
headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
}