Skip to content

Instantly share code, notes, and snippets.

View josephdburdick's full-sized avatar
😇
Mentally present

Joe josephdburdick

😇
Mentally present
View GitHub Profile
@josephdburdick
josephdburdick / scroll-effects.js
Created July 29, 2016 03:49
Various scroll effects jquery
jQuery(document).ready(function($){
var content = $('.works');
if( content.length > 0 ) {
// cache jQuery objects
var windowHeight = $(window).height(),
works = content.find('.work'),
navbar = $('.navbar'),
workSidebarLinks = navbar.find('li');
// initialize variables
@josephdburdick
josephdburdick / smarten.js
Created July 7, 2016 20:32 — forked from hkfoster/smarten.js
Replace dumb quotes with smart quotes, double dashes with an em dash, and three dots with an ellipsis.
// Make punctuation smarter
jQuery.fn.smarten = (function() {
function smartenNode(node) {
if (node.nodeType === 3) {
node.data = node.data
.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // Opening singles
.replace(/'/g, "\u2019") // Closing singles & apostrophes
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c") // Opening doubles
.replace(/"/g, "\u201d") // Closing doubles
@josephdburdick
josephdburdick / _outline-buttons.scss
Created March 30, 2016 12:41
Outline Bootstrap Buttons Partial
button, .btn{
&:focus,
&:active,
&:hover{
outline:0px !important;
-webkit-appearance:none;
}
}
.btn{
@josephdburdick
josephdburdick / _bootstrap-flexboxgrid.scss
Last active March 4, 2016 19:24
Flexbox x Bootstrap grid
.container-fluid,
.container,
%container {
margin-right: auto;
margin-left: auto;
padding-right: #{$grid-gutter-width};
padding-left: #{$grid-gutter-width};
}
.row,
@josephdburdick
josephdburdick / grid-width.scss
Created February 13, 2016 20:36
Bootstrap grid-width mixin
@mixin grid-width($cols, $has-gutter:true) {
@if $has-gutter {
width: calc(((100% / #{$grid-columns}) * #{$cols}) - #{$grid-gutter-width});
margin-left: $grid-gutter-width / 2;
margin-right: $grid-gutter-width / 2;
} @else {
width: calc((100% / #{$grid-columns}) * #{$cols});
}
}
@josephdburdick
josephdburdick / mobile-config.js
Created February 7, 2016 16:44
Example config for Cordova app
App.info({
name: 'App Name',
version: '1.0.0',
description: 'App Description',
author: 'YOU',
email: '[email protected]',
website: 'http://j0ey.co'
});
// Set up resources such as icons and launch screens.
@josephdburdick
josephdburdick / onScrollEndofPageTrigger.js
Created October 20, 2015 18:57
Scroll to bottom of page, transition to next route.
$(function($) {
let $appContainer = $('#app');
// window.scrollTo(0, 0);
window.onscroll = function() {
let thisScrollTop = Math.round($(this).scrollTop()),
thisInnerHeight = Math.round($(this).innerHeight()),
containeR = window,
containeD = document,
scrollPercent = 1 * $(containeR).scrollTop() / ($(containeD).height() - $(containeR).height());
@josephdburdick
josephdburdick / jquery-loadCarousel.js
Created October 19, 2015 22:48
The biggest carousel loading script that ever existed.
/*
jslint node: true, browser: true, devel: true, strict:false, debug:true
Load Bootstrap Carousel
Dependencies: lazyloadsrcset
by: Joe Burdick
*/
/*jshint -W087 */
@josephdburdick
josephdburdick / _grid.scss
Created October 10, 2015 03:49
Fastest SCSS grid system
$class-slug: col !default;
$gutter: 1rem;
.clearfix{
&:before,
&:after {
content: " ";
display: table;
}
&:after {
@josephdburdick
josephdburdick / generateRandomHex.js
Created October 7, 2015 19:08
Random Hex color generator
require([
'react',
'lodash',
'jquery'
], function(React, _, jQuery) {
var getRandomColor = _.memoize(function(tok) {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {