Skip to content

Instantly share code, notes, and snippets.

View sdougbrown's full-sized avatar

Doug Brown sdougbrown

View GitHub Profile
@sdougbrown
sdougbrown / bower.json
Created June 28, 2016 14:45
SCSS Skelly Boilerplate
{
"dependencies": {
"skelly": "git://github.com/sdougbrown/skelly-scss.git"
}
}
@sdougbrown
sdougbrown / sticky.js
Last active July 5, 2016 16:57
Sticky Elements By Waypoint (jQuery, requestAnimationFrame) -- scrolljack without jacking scroll
// Sticky
//
// A sticky element that determines its state by another
// element's position in the document.
(function ($, requestAnimationFrame) {
var pluginName = 'sticky';
var pluginDefaults = {
waypoint: '.js-waypoint',
includeWaypointHeight: false,
@sdougbrown
sdougbrown / toggler.js
Created July 5, 2016 16:56
Toggling jQuery Plugin
// Toggler
//
// A generic toggling plugin.
// This plugin assumes that a parent element ($el)
// will contain both a 'toggler' and a 'togglee'
//
// The 'toggler' is the item that is clicked,
// while the 'togglee' may be a navigation menu
// or some other element that changes when another
// element toggles it.
(function () {
var CHECK_INTERVAL = 100;
var CURRENT_PATH = window.location.pathname;
var PREVIOUS_PATH = "";
function checkPath () {
if (CURRENT_PATH !== window.location.pathname) {
PREVIOUS_PATH = CURRENT_PATH;
CURRENT_PATH = window.location.pathname;
@sdougbrown
sdougbrown / tools.media.scss
Last active July 25, 2016 20:32
Media Query Mixin (BlazeCSS)
// Media Queries
// Usage: @include media(size){ [styles here] }
$screen-limit-xsmall: 20em !default;
$screen-limit-small: 30em !default;
$screen-limit-medium: 48em !default;
$screen-limit-large: 64em !default;
$screen-limit-xlarge: 78em !default;
$screen-limit-super: 116em !default;
@sdougbrown
sdougbrown / nerdtree_colors.vim
Created September 26, 2016 02:20
vim NERDtree flattown
" Open NERD tree
map <C-g> :NERDTreeToggle<CR>
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
" purple
@sdougbrown
sdougbrown / is.js
Created October 26, 2016 15:54
Boolean gettersetter w/ pre-bound callbacks
function is(bool) {
function gs() {
if (arguments.length) {
bool = arguments[0];
}
return !!bool;
};
gs.setTrue = () => gs(true);
gs.setFalse = () => gs(false);
@sdougbrown
sdougbrown / is.js
Created October 26, 2016 15:54
Boolean gettersetter w/ pre-bound callbacks
function is(bool) {
function gs() {
if (arguments.length) {
bool = arguments[0];
}
return !!bool;
};
gs.setTrue = () => gs(true);
gs.setFalse = () => gs(false);
@sdougbrown
sdougbrown / emoji.scss
Created October 31, 2016 18:28
emoji.scss
@font-face {
unicode-range : U+1F431-U+1F63A;
}
.c-emoji:before {
font-style: normal;
}
$emojiList:
"arrow-up" "⬆️",