Skip to content

Instantly share code, notes, and snippets.

View PerpetualBeta's full-sized avatar

Jonathan M. Hollin PerpetualBeta

View GitHub Profile
@WebReflection
WebReflection / Delayed.js
Last active March 4, 2020 23:39
whenever you need to execute something after an interaction that might happen many times (panning, scrolling, etc) … this simple mechanism makes simple to execute that maybe expensive operations only once when things are "quiet" and never before or in the middle, if an action start as "start panning" would be is fired and it's calling the clear(…
/*jslint browser: true, indent: 2 */
var Delayed = (function (delay) {
/*! Andrea Giammarchi - Mit Style License */
// https://gist.github.com/WebReflection/7286687
'use strict';
// method shared across all delayed wrappers
function clear() {
@AllThingsSmitty
AllThingsSmitty / css-not.scss
Last active November 28, 2018 16:16
Use CSS :not() instead of applying and unapplying borders on navigations
.nav-tab {
...
// instead of putting it on
border-right: 1px solid #424242;
&:last-child {
border-right: 0; // and then taking it off
}
// use CSS not() to only apply to the elements you want
&:not(:last-child) {
border-right: 1px solid #424242;
@driscollwebdev
driscollwebdev / usefulStyles.css
Created October 8, 2012 14:45
CSS to horizontally center an IMG element
img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}